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
- Shader Graph Node information is briefly displayed in Graph Inspector when clicking on Category in the Blackboard
- Module installation fails with "Download failed: Validation Failed" errors when using beta.2 Hub version
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Shader Graph Category dropdown cannot be expanded/collapsed when clicking on the text
- Different text alignment in the column header in Entities "System" window
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