Search Issue Tracker
Fixed
Votes
1
Found in
5.4.0b10
Issue ID
784547
Regression
No
EditorGUILayout.EnumMaskField is misleading by stating that Enum is returned
Steps to reproduce:
1. Open attached project
2. In top menu, open window "Tools > EditorGUILayout.EnumMaskField Reports Incorrect Value"
3. In Enum dropdown, select "Two"
4. Notice that value returned by EditorGUILayout.EnumMaskField is 4 although originally enum stores 2
Note: Although this behavior is correct it is misleading. EnumMaskField returns Enum so it is expected for it to return Enum of the same type that was passed and containing all the original values. However, it returns at bitmask of selections.
Reproduced with: 5.2.4f1, 5.3.4f1, 5.4.0b13
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- VFX Graph Memory leak when calling the ClearPropertyBinders and AddRemoveVFXProperty
- Entering "Configure Avatar" inside the Inspector locks it
- [Render Graph Viewer] Resource list icons cropped and in inconsistent positions
- Scene View with Debug Draw Mode enabled is gray when GPU Resident Drawer is enabled
- The UI is not visible when resizing out of focus built Player window with Application.runInBackground set to false
LazloBonin
Nov 22, 2017 18:00
In the mean time, here's a workaround that fixes the field's behaviour entirely:
https://forum.unity.com/threads/editorguilayout-enummaskfield-doesnt-use-enums-values.233332/#post-3297123
chasepettit
Jan 12, 2017 01:39
While I'm sure this is probably by design and won't be fixed, I'd just like to chime in and say that I agree that it's very misleading and confusing behavior and leads to having to do more casting/conversion work than should be necessary in most cases.