Search Issue Tracker
By Design
Under Consideration for 2021.3.X, 2022.3.X, 2023.2.X, 2023.3.X
Votes
0
Found in
2021.3.33f1
2022.3.14f1
2023.2.2f1
2023.3.0a16
Issue ID
UUM-57223
Regression
No
List items wrongly initialized in the Inspector when values are declared in the constructor
How to reproduce:
1. Open the attached project "90_develop.zip"
2. Select "Test" in the Inspector window
3. Add a new Element to the "Items" list in the Inspector window
Expected results: "Var 1" and Var 2" are set to "10" and "20"
Actual results: "Var 1" and Var 2" are both set to "0"
Reproducible with: 2021.3.33f1, 2022.3.14f1, 2023.2.2f1, 2023.3.0a16
Reproducible on: Windows 11 22H2
Not reproducible on: No other environment tested
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.
When the first element is added to an array via SerializedProperty it is allocated by zeroing the memory rather than calling the constructor. And when adding additional elements it copies the previous element. We will consider changing that behavior as part of future quality improvement work in the area of SerializedObject/SerializedProperty but also wary of any possible performance and backward compatibility impact for changing this behaviour.
Today we will be closing this case. Thank you again for taking the time to report this issue