Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
As usual, we use StaticMeshActor as the base class for our Actor so that we can easily give it a visual representation in the level.
Enumerated types are exposed to the reflection system using the UENUM macro.
We mark the enum as Blueprint-available using the BlueprintType specifier.
The enum declaration is just the same as we would use in any other context.
Our Tree requires a TreeType. Because tree has tree-type is the relationship we want to embody, we include an instance of TreeType in our Tree class.
As usual, we need to use UPROPERTY() to make the member variable accessible to the reflection system.
We use the BlueprintReadWrite specifier to mark the property as having both get and set support within Blueprint.
Enumerated ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access