Delegates
Delegate Declaration
// Delegates need the attribute to generate the correct glue for the type.
// Multicast delegates.
[UMultiDelegate]
public delegate void FMyShowcaseMulticastDelegate(int a);
// Single delegates.
[USingleDelegate]
public delegate void FMyShowcaseDelegate(int a);Class Member Declaration
[UClass]
public class ADelegateShowcaseClass : AActor
{
[UProperty(PropertyFlags.BlueprintAssignable)]
public partial TMulticastDelegate<FMyShowcaseMulticastDelegate> MyMulticastDelegate { get; set; }
[UFunction(FunctionFlags.BlueprintCallable)]
public void MyFunctionWithCallback(TDelegate<MyShowcaseDelegate> singleDelegate)
{
}
// Single delegates as properties can't be Blueprint exposed, but reflection exposed. Unreal Engine limitation.
[UProperty]
public partial TDelegate<FMyShowcaseDelegate> MySingleDelegate { get; set; }
}Delegate API Example
Last updated