I wanted to ask if there’s a possibility to set values of blackboard variables of serializable classes via the blackboard.
Example:
I have a class
1
2
3
4
5
[Serializable]
publicclassFoo{
publicinta;
publicfloatb;
}
And I have a variable of type Foo on my blackboard. Is there a way to draw the inspector that unity would draw for this class when it’s exposed in a normal inspector window or do I have to implement a custom object drawer?
I seem to have fixed it but I’m kinda wondering why this wasn’t implemented already. Was there a reason why you chose to not show SerializeField fields?
In case you want to add it to the asset here’s the changed code in the EditorUtils_GUI class:
The problem with having all serializable private fields show like this, is that within the NodeCanvas Editor node inspector, inherited fields of the base classes of ActionTask, ConditionTask or even Node and Variable for example, will also show, even though they are not really supposed to be shown, since the inspector there also use that piece of code you posted in EditorUtils_GUI.cs file.
I could of course go ahead and add [HideInInspector] in all those private serializable fields in those base classes to avoid this, but it’s not really an optimal solution.
Hmm.. I will need to think for a bit better workaround about this limitation, as I understand that this can be problematic in some cases.
Thanks for bringing this into my attention!
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.