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
- WebGPU: ASTC texture mip levels are corrupt
- [Vulkan] Crash on with multiple stack traces when rendering large Terrain with specific hardware
- Crash on SkinnedMeshRendererManager when interacting with a prefab generated with uncombined meshes using Synty Sidekick Character Creator
- Crash on folly::detail::safe_assert_terminate_v when updating the Meta XR SDK Packages
- The text font falls back on a different font depending on the fallback font used
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.