This recipe shows you how to use the concepts that were introduced in the previous recipes to create an actor that informs other actors of the passage of time within your game.
Creating a Time of Day handler
How to do it...
- 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:
FOnTimeChangedSignature OnTimeChanged;
- Add the following properties to the class:
UPROPERTY() int32 TimeScale...