Extension / Mixin Methods
C++ Extension Methods for C#
Usage Requirements
Example
UCLASS()
class UCSTestExtensions : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
// Example of an extension method that takes an int parameter
// public static void ExtensionMethod1(this Actor actor, int value)
UFUNCTION(meta=(ExtensionMethod, ScriptMethod))
static void ExtensionMethod1(AActor* Actor, int32 Value) {};
// Example of an extension method that takes a float parameter
// public static void ExtensionMethod2(this Actor actor, float value)
UFUNCTION(meta=(ExtensionMethod, ScriptMethod))
static void ExtensionMethod2(AActor* Actor, float Value) {};
};Last updated