"All" Flags Enum Value displayed as "Mixed (n)" where 'n' is the number of values in the Enum.
What Happened
When selecting “All” in the Odin Inspector (not “Improved”) Enum Drop Down, the value displayed is “Mixed (n)”, with ‘n' being the number of values in the Enum and the value serialised isn’t “-1” as it should be. This means that if another enum value is added, it will not be selected in existing serialised values. Hence the value “All” isn’t persisted.
Repro steps
* Create an enum with the “Flags” attribute and values that are powers of 2 (1, 2, 4, 8, etc).
* Create a serialised field of this type in a Scriptable Object or MonoBehaviour.
* Create an Asset or Prefab using this script and inspect it in the Editor.
* (Disable the “Use Improved Enum Drop Down” in the Odin Settings (General > Enums).
* Select All in the Drop Down.
* Note that the value is set as “Mixed (n)” (n = 7 in screenshot here)
* If opening the serialised file the value is set to 2^n-1.
* All should set the value to -1 and the value “All” should be displayed when the dropdown is closed.
Screenshots
Screenshot of Odin’s inspector:
Screenshot of the standard Unity Enum Flags Inspector:
Unity Version
2019.2.6f1
Odin Version
2.1.6
Editor Only Mode
Yes.
Operating System
Windows 10 Pro version 1903 Build 18362.535