Serializable class drawer

NodeCanvas Forums Support Serializable class drawer

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12365
    almostbearded
    Participant

    Hi,

    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

    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?

    Thx for the help.

    #12367
    almostbearded
    Participant

    I actually just realized that this seems to be working. The issue I’m having is when I use

    Is there a way to make the NodeCanvas drawer draw my private serialized fields or do I need to make them public?

    Sorry for the confusion.

    #12368
    almostbearded
    Participant

    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:

    #12378
    Gavalakis
    Keymaster

    Hello,

    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.