Serialization and scripting

To finish with our theory for this chapter, we need to cover serialization in Unity. Now, Unity already serializes just about everything from the editor to your scene automatically (with a few exceptions) when it saves and loads the scene.

Note

There are a few fringe cases where Unity will not serialize some data. These cases have to do with the current limitations of the Mono 2 framework that Unity uses under the hood. A full explanation of what doesn't work can be found in the following article; note that it is very technical and includes a link to the error report in Unity where it is recorded: http://www.codingjargames.com/blog/2012/11/30/advanced-unity-serialization/

However, what if we want to actually use this ...

Get Mastering Unity 2D Game Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.