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
- [iOS] ListView is flickering when scrolling over the end
- The Aspect Ratio Fitter Component on a Prefab displays a parent-related warning despite the Prefab's inability to have parents when "Envelope Parent" or "Fit In Parent" modes are used
- HDRP Color Picker preview rectangle doesn’t update when adjusting colors for Camera Background Type Color
- Progress indicator in Meta Quest Build Profile configuration is barely visible
- Slightly transparent objects disappear completely in Web Player when using RenderGraph
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.