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
- Package Manager's Filter Panel does not show borders when viewed on Windows
- Blend Tree Threshold fields accepts NaN/Infinity values causing Node backgrounds disappear in Animator Controller view
- Port keyboard selection sync improvements from legacy UGUI InputField to TMP_InputField
- Animator Controller Layer Weight field accepts “NaN” as a valid value instead of rejecting it
- Package Manager redirection buttons are changed to "Checkmarks" after installing additional Packages in the Multiplayer Center
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.