Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
The first class is the actual object that can exist in the game at runtime. It's your texture, data file, or curve data – whatever you require.
For the purpose of this recipe, the simplest example is an asset that has an FString property to contain a name.
The property is marked as UPROPERTY so that it remains in memory, and additionally marked as EditAnywhere so that it is editable on both the default object and on instances of it.
The second class is Factory. Unreal uses the Factory design pattern to create instances of assets.
This means that there is a generic base Factory that uses virtual methods to declare the interface of object creation, and then Factory subclasses are responsible for creating the actual object in ...
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