void UK2Node_ActorBoundEvent::DestroyNode()
{
	if( EventOwner )
	{
		// If we have an event owner, remove the delegate referencing this event, if any
		const ULevel* TargetLevel = Cast<ULevel>(EventOwner->GetOuter());
		if( TargetLevel )
		{
			ALevelScriptActor* LSA = TargetLevel->GetLevelScriptActor();
			if( LSA )
			{
				// Create a delegate of the correct signature to remove
				FScriptDelegate Delegate;
				Delegate.BindUFunction(LSA, CustomFunctionName);
				
				// Attempt to remove it from the target's MC delegate
				if (FMulticastScriptDelegate* TargetDelegate = GetTargetDelegate())
				{
					TargetDelegate->Remove(Delegate);
				}				
			}
		}
		
	}

	Super::DestroyNode();
}
void UK2Node_ActorBoundEvent::ReconstructNode()
{
	// Ensure that we try to update the delegate we're bound to if its moved
	GetTargetDelegate();

	CachedNodeTitle.MarkDirty();

	Super::ReconstructNode();
}
Exemplo n.º 3
0
bool ClickLayer::TouchEnd(NDTouch* touch)
{
	if (!this->IsVisibled())
	{
		return false;
	}

	NDUITargetDelegate* delegate = GetTargetDelegate();

	if (delegate)
	{
		return delegate->OnTargetBtnEvent(this, TE_TOUCH_BTN_CLICK);
	}

	return false;
}