arimger/Unity-Editor-Toolbox

Label By Child Attribute Conflicts with ReorderableList Attribute .

Closed this issue · 12 comments

Looking for Similar feature of Allow Nesting Attribute from Naughty Attributes, Which allows its attributes to work inside other Classes.

For Eg.

[SerializeField] private List<RandomClass> roads = new List<RandomClass>();

public class RandomClass
{
    [ShowIf(...)] public float floatValue;
    [ShowIf(...)] public string stringValue;
    [ShowIf(...)] public int intValue;
}

ShowIf here does not work when these values are drawn in the inspector and will be shown even when it is false.

There is no need for such attribute like AllowNesting, this should work as expected by default. You can check the examples in the project for more details.

Let's try to fix it.
Only the ShowIf and other conditional attributes are not working or attributes like InLineEditor too? Do you have issues only in lists or:

[SerializeField] 
private RandomClass randomClass;

works ok?

Do you use any additional Inspector-based plugins in the project? NaughtAttributes, Odin, etc.

I will try your requests in a day or so with other attributes as well and let you know soon.

And i am using naughty attributes which is modified to use this plugins Toobox Editor.

Found the issue, it's the [LabelByChild("variableName")] , using this on the list with [ReorderableList(ListStyle.Round, Foldable = true)] (not sure if ReorderableList is relevant here) it overrides all of the attributes of the class inside the list.

I will do some testing with them and post an update soon.

While we are here, what's the equivalent Naughty Attributes Label in this plugin, the Label in this plugin is adding a header. I need an Attribute that changes the variable name in the inspector only.

As mentioned in the README.md, LabelByChildAttribute is unfortunately part of the old, non-Toolbox attributes so it overrides all Toolbox-only features.

While we are here, what's the equivalent Naughty Attributes Label in this plugin, the Label in this plugin is adding a header. I need an Attribute that changes the variable name in the inspector only.

NewLabelAttribute

LabelByChildAttribute is unfortunately part of the old, non-Toolbox attributes so it overrides all Toolbox-only features.

any plans to fix this in the future?

also I dont see it being mentioned anywhere near the LabelByChildAttribute part in the readme file.

Unfortunately, it was briefly mentioned only on the Wiki page. I will change it in the next update.

any plans to fix this in the future?

Yes, I plan to transfer all "regular" drawers into Toolbox drawers to support all features.

I modified the ToolboxEditorList to support LabelByChild by a bool input and works good.

If i have some free time left, i will see if i can pr this feature in.

Sure, feel free, I'll try to move LabelByChild to the Toolbox drawers as soon as possible.

Hello, I added better support for the LabelByChildAttribute in #73. Your PR can probably be declined.