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
- Shader Graph Node information is briefly displayed in Graph Inspector when clicking on Category in the Blackboard
- Module installation fails with "Download failed: Validation Failed" errors when using beta.2 Hub version
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Shader Graph Category dropdown cannot be expanded/collapsed when clicking on the text
- Different text alignment in the column header in Entities "System" window
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.