Could the node'task use custom class let the variable be used like CutomEditor?

NodeCanvas Forums General Discussion Could the node'task use custom class let the variable be used like CutomEditor?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15874
    shortlin
    Participant

    We know Unity can use CutomEditor in inspector to let some variable be hidden when the user chose different enum in drop down menu.
    I know NodeCanvas could add the custom class to the new type, use the custom class to show all the variables in the node’s task.But if I want to let the display like the inspector,such as we chose the enum type1, var1 show and var2 hidden, chose the enum type2,var1 hidden,var2 show.
    Could we do this? thank you.

    #15886
    shortlin
    Participant

    Finally I found NodeCanvas could use ShowIfAttribute to do this.

    public enum ENUM
    {
    showVar1,
    showVar2

    }

    ENUM Kind;

    [ShowIfAttribute(“Kind”, (int)ENUM.showVar1)]
    public int var1;

    [ShowIfAttribute(“Kind”, (int)ENUM.showVar2)]
    public int var2;

     

    #15916
    Gavalakis
    Keymaster

    Hey,

    Yes the ‘ShowIf’ attribute does that as you have already found out 🙂 There are a few other inspector-related attributes as well.

    Join us on Discord: https://discord.gg/97q2Rjh

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