- Inside our Unreal project's GameMode header, declare the delegate with the following macro, just before the class declaration:
DECLARE_DELEGATE(FStandardDelegateSignature)UCLASS()class CHAPTER_05_API AChapter_05GameModeBase : public AGameModeBase
- Add a new member to our game mode:
DECLARE_DELEGATE(FStandardDelegateSignature)UCLASS()class CHAPTER_05_API AChapter_05GameModeBase : public AGameModeBase{ GENERATED_BODY()public: FStandardDelegateSignature MyStandardDelegate;};
- Create a new Actor class called DelegateListener:
- Add the following to the declaration of that class:
UFUNCTION() void EnableLight(); UPROPERTY() ...