arimger/Unity-Editor-Toolbox

Reorderable List overrides any toolbox attributes

Closed this issue · 3 comments

Conditionals/Decorators won't work with reorderable list items
Update: They don't work with list items either

Some more info:

Use case is a class like so

[Serializable]
public class Node
{
     public bool someCondition;
     [ReorderableList]
     [ShowIf("SomeCondition", true]
     public List<Node> children;
}

[Serializable]
public class Tree : ScriptableObject
{
    public Node rootNode;
}

Hello, Conditionals & Decorators should work for the whole list/array, I mean in your particular case whole children list shouldn't be visible if "SomeCondition" (in your example is a small error because you should use "someCondition") is true. If it's not working then indeed it's a bug. Do you get any warnings/errors? What version of the Unity Editor are you using?

@arimger no warnings/errors. I'm on 2020.3.4f1. Also this script is a demo so some typos in it.

I tested it and:
image
image

everything looks fine, I used code from your example. Things that may break Toolbox Attributes:

  • another Editor-based plugin (MyBox, NaughtyAttributes, Odin, etc.)
  • custom Editor created for your type
  • you have disabled/removed certain attributes in Toolbox Settings