Search Issue Tracker

By Design

Votes

0

Found in

5.6.0p1

Issue ID

905460

Regression

No

Adding new elements to the Array, it ignores declared values in the script

Serialization

-

If you have a property that is an array, when adding a new entry (changing the Size displayed in the Inspector), the constructor of the new object will run, but all properties of the array will be 0 or empty.

To reproduce:
1. Download attached project "NullProperty.zip" and open in Unity
2. Open "Scene" scene
3. Create new Game Object and add the ArrayProperty component
4. Change ArrayProperty component Size in Inspector window

Expected result: The Console will print out "Made an Inner! Current Values = {A=0.1 B=0.1 S=str}" for every new entry you add in Inspector and
A property will show "0.1" value, B property will show "0.1" value and S property will show "str" value
Actual result: The Console will print out "Made an Inner! Current Values = {A=0.1 B=0.1 S=str}" for every new entry you add in Inspector but all values of properties will be 0 or empty

Reproduced on Unity 5.5.3p2, 5.6.0p3 and 2017.1.0b2

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.