Comments

  • For Serialization to work, you'll need to import the System.IO and System.Xml.Serialization namespaces. The former library contains classes and functions for saving data to files on the local computer, and the latter for converting data in the memory to an XML string.
  • The TransformationDataXML class is declared using the [System.Serializable] attribute. This means that the class contains properties that can be transformed to text for Serialization, and it can also show its values in the object Inspector, if declared as a public object.
  • The TransformationDataXML class contains all the data needed to save a transform component to a string. The variables Vector3 (for position and scale) and a Quaternion (for rotation) do not, by default, ...

Get Mastering Unity 2017 Game Development with C# - 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.