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
Comments (2)
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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.