"None" option in dropdown for enum types marked with [Flags] does not work

Issue #143 resolved
Tarocco created an issue

For flag enum fields, Odin will create an improved dropdown menu for the inspector.

The "All" option is working as a toggle for all of the flags, and the "None" option raises this exception:

InvalidCastException: Cannot cast from source type to destination type.
Sirenix.Utilities.Editor.SirenixEditorFields.EnumMaskSetValueDelegate (System.Object value) (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Utilities.Editor/GUI/SirenixEditorFields.cs:3125)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:125)

Comments (2)

  1. Tor Esa Vestergaard
    • changed status to open

    Thanks for reporting this issue. I just tried to replicate this with no luck - could you paste your enum definition in here?

  2. Tor Esa Vestergaard

    After some further testing, I did manage to replicate this. Enums for all types of both negative and positive values now work. This fix will make it into the next patch.

  3. Log in to comment