Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2018.4.0f1
2019.1.0a1
2019.2.0a1
2019.3.0a1
Issue ID
1163703
Regression
No
Object with ISerializationCallbackReceiver Interface receives Serialization Callback when it has a private access level
How to reproduce:
1. Open the "Scene" Scene in the attached "CustomSerializationPrivateFieldError.zip" Project
2. Right-Click > Reimport "Test.cs" in the Project View
3. Observe the Console
Expected Behaviour: The Callbacks are not responding due to private access level of "CustomType" Variable in the "Test.cs"
Actual Behaviour: The Callbacks are called
Reproducible with: 2017.4.29f1, 2018.4.3f1, 2019.1.7f1, 2019.2.0b6, 2019.3.0a6
Note: If you specify "[NonSerialized]" before declaring the Field - no Callbacks are Invoked.
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
- Joint Physics result in unexpected behaviors when used for articulated vehicles like buses or trucks
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts which worked with TMP Font Asset Creator
Resolution Note (2020.1.X):
ISerializationCallbackReceiver are called for any serializable object, regardless of whether it has private fields that are not serializable.