- Create a new Actor class called TimeOfDayHandler, as shown in the following screenshot:
- Add a multicast delegate declaration to the header:
DECLARE_MULTICAST_DELEGATE_TwoParams(FOnTimeChangedSignature, int32, int32)UCLASS()class CHAPTER_05_API ATimeOfDayHandler : public AActor
- Add an instance of our delegate to the class declaration in the public section:
- Add the following properties to the class:
int32 Hours; UPROPERTY()
- Add the initialization of these properties to the constructor: ...
Get Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.