I have a C++ class called ‘AEntity’, which is the base for multiple Blueprint classes created in the editor. The goal is to get a list of Blueprint classes deriving from ‘AEntity’, so that a random entry can be selected later for actual spawning.
Discovering the assets seems to be working, I can get the ‘FAssetData’ of all derived Blueprints, but I am confused about how to get the actual ‘UClass*’ so I can return
‘FAssetData’ provides us with a ‘GetClass()’ function, but that returns a class called ‘Blueprint’, which might be related to ‘FoundAssetData.IsUAsset()’ returning true.
Now the solutions that I have encountered suggested using ‘FoundAssetData.GetAsset()’ and casting it to ‘UBlueprint’ so I can get the ‘GeneratedClass’, but that would load the object if it doesn’t exist, which I don’t want for two reasons:
-there could be hundreds of assets that I would not want to load just to get their classes (if such a thing is possible)
-the function that collects the assets can be called from other threads, and loading ‘UObjects’ is only allowed in the game thread.
Any help would be appreciated.