I have a class that I want to get the property using the get property action in NodeCanvas. I cannot find my class in the ‘select property’ list. I have added added [NodeCanvasPreferredType] annotation and checked that the type is in the NodeCanvas list already. How can I get the properties of my class?
My class is below, How will I get the TestPropertyOne?
The “Script Control” reflection tasks (Execute Function, Get/Set Property etc), at least right now, only work with Component derived types, because the Tasks themselves also only work with Component derived types for the agent. This is something that has been requested before though, so it is quite high on my roadmap to implement/change.
Where did you find the [NodeCanvasPreferredType] attribute by the way? Such an attribute does not exist in NodeCanvas :).
I have to create our class dynamically based on incoming REST requests from users. I cannot use Monobehaviours for this because I would have to add it to the gameObject, which will slow things down significantly. What are other Components that can be created without adding to the gameObject? Or Is there any other way of doing this?
As for [NodeCanvasPreferredType] it is an internal attribute we use to add PreferredTypes:
Thanks for the follow up and the details.
That sounds like a valid solution I think. The [NodeCanvasPreferredTypeAttribute] is also a good idea. I might add this officially as well 🙂
Thanks.