Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2018.4.27f1
2020.2
Issue ID
1282815
Regression
No
The "Everything" option in EnumFlagsField is not overridden with unsigned values
How to reproduce:
1. Open the attached project("EnumFlagsFieldBugReport.zip")
2. Select "ExampleObject1" in the Hierarchy
3. Click on the dropdown of "Int Flags Hex All Field" in the Inspector window
Expected results: "Everything" is overridden with "Hex All"
Actual results: "Everything" is not overridden with "Hex All"
Reproducible with: 2018.4.28f1, 2019.4.12f1, 2020.1.8f1, 2020.2.0b6
Comments (1)
-
CodeRonnie
Dec 03, 2020 16:30
The issue really had nothing to do with which flags were enabled. This issue was only ever related to which names are displayed in the editor. If the user includes an element in their enum with a value of ~0, such as All = ~0, then the Everything value that Unity displays by default is not displayed, All is displayed instead. However, this is only true for enums that use int as the underlying type, and it is not true in any case when using an appropriate value equivalent to ~0 defined in the form of 0xFFFFFFFF. The values ~0 and 0xFFFFFFFF are functionaly equivalent, but only ~0 has an effect on which names are displayed in the editor. The bug has nothing to do with the functionality of which flags are enabled or disabled, only what names are displayed in the editor.
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
- Getting a deprecated package for JetBrains Rider pop up when opening or creating a project
- [Android] Volume level of the same audio file is different on Samsung Galaxy Tab A8 between 2023.3.0b3 and 2023.3.0b4
- ‘Expected end of value’ warning occurs when a property declaration includes five or more variable references
- Tags window completely breaks and throws Exception errors when Adding a Tag to a GameObject
- Crash on BurstCompilerService::CompileAsync when entering Play mode in a specific scene
Resolution Note:
As these are flags which are enabled and disabled based on the number underneath it when hex all (0xFFFFFFFF) is selected obviously all the flags will be enabled including Everything as well.
If the user wants to enable only Hex All and disable the rest of the flags, which is not possible.