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
- [Android] Stage information is not logged when Log Shader Compilation is enabled
- [Vulkan] The memory allocation increases rapidly when there are multiple (three or more) Real-Time Reflection Probes in the Scene
- [macOS] Library folder of the opened project can be deleted which leads to the crash
- “Default Scene” dropdown field contains a spelling mistake “Default Builtin”
- Editor crashes on PPtr<Mesh> after adding Text Mesh and Cloth Components to the same GameObject
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.