Search Issue Tracker
By Design
Votes
0
Found in
2021.3.31f1
2022.3.13f1
2023.1.20f1
2023.2.1f1
2023.3.0a15
Issue ID
UUM-56878
Regression
No
Readonly and "get" autoproperty variables in a class with Serializable attribute are assigned null values when script assemblies are reloaded and the default constructor is disabled
How to reproduce:
1. Open the attached “serializable_autoproperties_issue” project
2. In the toolbar, navigate to the “Repro > Serialization issue” window
3. Press the “Reload assemblies” button
4. Observe how some of the values are assigned null values until the window is reopened
Expected result: Variables are assigned the same values after script assemblies are reloaded
Actual result: Variables with certain properties are not initialized properly, and are not assigned their respective values
Reproducible in: 2021.3.31f1, 2022.3.13f1, 2023.1.20f1, 2023.2.1f1, 2023.3.0a15
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Note: As a workaround, introducing an empty default constructor in the script, i.e “public SerializableData() {}” is enough to prevent the issue from reproducing
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
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
- Editor crashes on D3D12GetInterface when repeatedly enabling and disabling 256 text components
- Flickering bright white dots in the Scene when the Android Platform is selected and DX11 Graphics API is used with Iris(R) Xe Graphics GPU
- Inconsistent capitalization and misaligned text in multiple query blocks in Search window
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
Resolution Note:
Thank you for reporting a bug to Unity.
Today we will be closing this case following the reporter's request as this is working as expected.