Changing UPROPERTY type based on other UPROPERTY
Is it possible to do with some C++ magic?
Fir example I have to variables, both declared in C++ base class.
First store the Object Class and is set up from subclassed blueprint. Second is instance Variable and it's type should change to the value set in firs variable, or be Object if null.
Is that kind of magic possible in C++? Have anybody did something like that? Maybe some tweaking of Class properties can be implemented at runtime? That is expected to be some kind of template mechanism.
asked Jan 24 '17 at 07:24 AM in C++ Programming
Templates wont do anything for you, since they evaluate at compile time, and you are looking to do stuff at runtime.
Do you want the variable to be of arbritrary class?
For example: Could it be anything from an
If they have some functionallity in common however, for example they all have one method that you want to call, you could derive all your variableClasses from a parent class. Your variable then stores a pointer to this parent class, and you can assign any object of the subclasses to it. You could then call your method using virtual functions. Also check out
answered Jan 24 '17 at 10:55 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here