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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.