- Home /
OnBeforeSerialize and OnAfterDeserialize order guarantees
Hello,
I have read Unity's documentation on the matter (http://docs.unity3d.com/ScriptReference/ISerializationCallbackReceiver.OnBeforeSerialize.html), and I can understand that I should not depend on the order of serialization or deserialization, i.e. when an object is deserializing, I shouldn't attempt to access another object that's also deserializing.
However, this leaves some questions still unanswered:
Are all OnAfterDeserialize calls guaranteed to happen after all OnBeforeSerialize calls?
Why are lists in that example assumed to already have been deserialized? Does it mean that OnAfterDeserialize calls are guaranteed to happen after Unity has deserialized everything that does not inherit the interface and can be serialized by default (which means that the warning about having code interleaved with Unity's serialization only applies to OnBeforeSerialize)?
Thank you.
Your answer
Follow this Question
Related Questions
Help with Binary serialization/de-serialization of List items and the WEBPLAYER 1 Answer
how to deserialize json with arbitrary string keys using JsonUtility(unity c#)? 4 Answers
EndOfStreamException : Failed to read past end of stream 1 Answer
UnityScript How To Deserialize? 1 Answer
EndOfStreamException : Failed to read past end of stream 1 Answer