I prototyped a number of functions and classes in blueprints and now I’m starting to convert them into C++. When a blueprint is created there are two types related to it, MyClass (blue icon) and MyClass_C (purple icon). I’ve accomplished MyClass properties no problem, but how does one deal with MyClass_C in C++? As far as I can tell MyClass is the specific instance, MyClass_C is more of a type specifier. Not sure how to translate this into C++.
The purple items (_C) are the classes themselves. For example, if I were to do typeof(MyClass) in C# the result of that would be a class object representing the reflection data of MyClass. The MyClass_C is pretty much that. You can access them in C++ by doing MyClass::StaticClass().
Hey, thanks for the reply.
Yeah, the part I’m unsure of is in blueprints I made a property that was of the type MyClass_C. This way I could specify any derivative of it as the value to the that property. I could then use this to spawn a new instance of that specific class. It was part of my inventory system. In C++ I don’t usually specify types as values so I’m a bit perplexed how to translate the blueprint to C++.
I can do:
TAssetPtr AMyClass BlueIconProperty;
To replicate the blue one. How can I replicate the purple one?
edit: markup is messing up my code, I hope you get my meaning.
Ah, you want a property of the class type that you can use for factoring and such.
UPROPERTY(blah) TSubclassOf<MyClass> MyClassType;
That’s exactly what I was looking for! Thank you so much.