Search Issue Tracker
Fixed
Fixed in 2021.3.23f1, 2022.2.14f1, 2023.1.0b12, 2023.2.0a8
Votes
0
Found in
2020.3.44f1
2021.3.18f1
2022.2.5f1
2023.1.0b1
2023.2.0a4
Issue ID
UUM-28904
Regression
No
Inconsistent behavior of EnumField initialization when an Enum type is used as a generic type
Reproduction steps:
1. Open the attached project “EnumProject”
2. Open the “Assets/EditorTest.cs” script and observe both variables (v1,v2)
3. In Unity’s Main Menu open “SSCCE>Show Test Window”
4. Observe that the first(v1) enum field has no default value displayed in the “DefaultNamespace.EditorTest” Window
Expected result: Value “A” is displayed in the first(v1) enum field
Actual result: No default value is displayed in the first(v1) enum field
Reproducible with: 2020.3.44f1, 2021.3.18f1, 2022.2.5f1, 2023.1.0b1, 2023.2.0a4
Reproducible on: Intel macOS 13.2
Note: The variable “v1” utilizes the static type “Enum” as a cast. The issue seems to be with using the Enum type as a generic type. When the EnumField's Init method is called with the Enum type, it is not able to determine the specific enum type at runtime, so it is unable to correctly display the value in the editor. By using a specific enum type instead of the Enum type as the generic type, the EnumField is able to correctly display the value.
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
- Foldout arrow indent is misaligned in the Inspector when used in Custom Type
- [Android] The Player screen turns black when playing a video under certain conditions
- Search window icons at the bottom are cut off when Search window is resized vertically
- "Try something else?" text label is cut off when searching for a long text in the Search window
- Rendering Debugger window sections do not have a minimum width set when resizing with the slider in the middle of the window
Resolution Note (fix version 2021.3.23f1):
Fixed 2021.3.X: Inconsistent behavior of EnumField initialization when an Enum type is used as a generic type