Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Declaring a delegate of MyDelegate type
- MyDelegate MyDel;
- //Binding a UFUNCTION to MyDel - this will not call the function just yet.
- MyDel.BindUFunction(this, FName("SomeFunction"));
- //Calling the bound function of the delegate
- MyDel.Execute();
- //Declaring a delegate of MyIntDelegate type
- MyIntDelegate IntDelegate;
- //Binding two UFUNCTIONs to IntDelegate - this will not call any function just yet
- IntDelegate.BindUFunction(this, FName("IntFunction"));
- IntDelegate.BindUFunction(this, FName("SecondIntFunction"));
- //Since the IntDelegate is a single-cast delegate it will only contain up to one function
- //In this case, the IntDelegate contains the last bound function
- IntDelegate.Execute(50);
- //Declaring a delegate of MyIntMulticastDelegate type
- MyIntMulticastDelegate Del;
- //Adding three UFUNCTIONs to the delegate - this will not call any function just yet
- Del.AddUFunction(this, FName("IntFunction"));
- Del.AddUFunction(this, FName("SecondIntFunction"));
- Del.AddUFunction(this, FName("ThirdIntFunction"));
- //Calling all the bound functions with a value of 10
- Del.Broadcast(10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement