[Flags] enum, 0 value is always "None" in dropdown even when explicitly defined otherwise
Issue #360
resolved
1)
[Flags]
public enum Species
{
Random = 0, //this will always show as "None" when selected in the inspector dropdown list. It should show "Random"
Human = 1,
Dragon = 2,
Bird = 4,
}
2)
public Species Species;
4) 2018
5) Odin version: 1.1.0.0 beta 8
6) No
7) High Sierra
Comments (3)
-
-
Updated, per Tor Vestergaard's comment about accounting for an undefined 0 value
tree.MenuItems.Insert(0, new OdinMenuItem(tree, Enum.GetName(typeof(T), 0)?.SplitPascalCase() ?? "None", 0));
-
- changed status to resolved
Fixed in the 2.0 beta (as it has now been rechristened).
- Log in to comment
Fix:
EnumSelector.cs line 146
to: