Search Issue Tracker
Fixed in 2022.2.X
Votes
0
Found in
Issue ID
1417532
Regression
No
Crash in SerializedProperty Enum in when class name repeated in different namespaces
Reported internally
Repro steps:
Load attached project
Add SerializeReferenceEnumCrash MonoBehaviour to a GameObject
Result:
Crash
The crash occurs in GetFieldIdentifierForEnum(),as the code tries to determine the path for a field to see if it is an enum, in a very specific scenario.
This only occurs when the Class containing the enum field is embedded (by-value) inside another Class of exactly the same name, but with a different namespace.
A workaround is to use [SerializeReference] instead of by-value serialization for the inner class, because Unity will be track it independently of the enclosing type.
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
- Memory usage rises when switching scenes with GRD enabled and a loaded texture in URP
- [Quality Hackweek] Terrain Brush Size value is not serialized after deselecting the terrain when using the first instance of multiple Inspectors
- "NullReferenceException" is thrown when setting a long string in TMP with "Atlas Population Mode" set to "Dynamic" and "Multi Atlas Textures" enabled
- TextMeshPro text is misaligned when alignment is set via script
- A DX11 shader error is thrown when compiling shaders for platforms without DX11 support
Resolution Note (fix version 2022.2):
Algorithm to match properties with enum information has been reworked to avoid potential crash, and to improve support for edge cases.
Fixed inĀ 2022.2.0a12