
上QQ阅读APP看书,第一时间看更新
Creating a blueprint from your custom UCLASS
Blueprinting is just the process of deriving a blueprint class for your C++ object. Creating blueprint-derived classes from your UE4 objects allows you to edit the custom UPROPERTY visually inside the editor. This avoids hardcoding any resources into your C++ code. In addition, your C++ class to be placeable within the level, it must be blueprinted first. But this is only possible if the C++ class underlying the blueprint is an Actor class-derivative.
There is a way to load resources (such as textures) using FStringAssetReferences and StaticLoadObject . These pathways to loading resources (by hardcoding path strings into your C++ code) are generally discouraged, however. Providing an editable value in a UPROPERTY() and loading from a proper concretely typed asset reference is a much better practice.