- edited description
Odin ignores InspectorName attribute
Unity allows changing the display name of enum values via the InspectorName attribute: https://docs.unity3d.com/2019.3/Documentation/ScriptReference/InspectorNameAttribute.html
In Unity, the values are displayed like so:
public enum MyEnum
{
[InspectorName("Test A")]
A,
[InspectorName("Test B")]
B
}
But with Odin, it always uses the enum names:
Unity 2019.3.7f1
Odin Inspector 2.1.11
Comments (7)
-
reporter -
Hm. Currently you can use [LabelText] to do the same in Odin, but we can add support for this attribute to Odin’s enum selector as well. Thanks for the heads-up, didn’t know about this.
-
-
assigned issue to
-
assigned issue to
-
reporter @Tor Esa Vestergaard LabelText seems to have some bugs when applied to enums. The selected value still shows the enum name (not the label text), and the first enum value still shows up on the dropdown. Example:
public enum CondType { [LabelText("==")] Equals, [LabelText(">=")] EqOrMore, [LabelText("<=")] EqOrLess, [LabelText(">")] More, [LabelText("<")] Less, [LabelText("!=")] NotEquals }
Shows up as:
I would expect “==” to show up instead of “Equals” (both in the value field and the dropdown)
-
In the next patch, it will - this was issue
#657, which was resolved yesterday :) -
- changed status to resolved
This has been resolved and will release with the next Odin patch.
-
InspectorName
is ignored when used withEnumToggleButtons
. Tested on Odin 3.0.1.0
- Log in to comment