Search Issue Tracker
Won't Fix
Votes
0
Found in
5.4.0f3
Issue ID
871740
Regression
No
Private variable's value from Serializable class persist when exiting play mode, instead of resetting to defaults
To reproduce:
1. Open attached project "EditorBugSerialValues.zip"
2. Open and Play "test" scene.
3. Press "+ 1" button few times.
4. Stop Play mode.
5. Press Play again.
Expected result: Value would be reset between play sessions.
Actual result: Value is saved.
Reproducible: 5.3.7p1, 5.4.4p4, 5.5.1p4, 5.6.0b10, 2017.1.0a2, 2018.3.0a6
This happens only in Editor. When project is built, it will save the value only between scenes, but not between play sessions.
Workaround:
Make the class not "Serializable", or make the value public instead of private.
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
- UI Toolkit 'background-size' property is not fully animatable
- Moving the Scrollbar via clicking no longer works after the first-click when page size is too small
- Elements in UI Builder Viewport are displayed incorrectly when Editor UI Scaling is set to 125%
- Prefab referencing a script is not shown in the Search window's Project tab when using "Find References In Project"
- Scroll view sensitivity remains unchanged when modifying the "--unity-metrics-single_line-height" value
Resolution Note:
This particular case has been investigated thoroughly and we have decided, in the interests of protecting the stability and features of Unity for users that rely upon the affected versions, to not address this fix for the time being. We understand that this will cause problems for some users, and so may address in a future version.