October 2016
Intermediate to advanced
452 pages
9h 47m
English
Inheritance is the second way to implement a custom Actor. This is commonly done to make a new subclass, which adds member variables, functions, or a Component to an existing Actor class. In this recipe, we are going to add a variable to a custom GameState subclass.
AMyGameState(); UFUNCTION() void SetScore(int32 NewScore); UFUNCTION() int32 GetScore(); private: UPROPERTY() int32 CurrentScore;
AMyGameState::AMyGameState() { CurrentScore ...Read now
Unlock full access