O'Reilly logo

Mastering Unity 2017 Game Development with C# - Second Edition by Alan Thorn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comments

  • The TransformData class is the serializable primitive object storing the raw transform data extracted from the transform component. However, for the JSON serializer, we'll use the Vector3 and Quaternion data types, as these serialize to a file without issues.
  • In the Awake function, all transform components are found using the Object.FindObjectsOfType function. This generates an array of found transform components in the TransformArray class variable.
  • The SaveData function is run to serialize all transform components in the scene to a specified JSON file in Application.persistentDataPath. This method only serializes all objects currently in the scene, and it assumes that each object has a unique name.
  • The SaveData function begins ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required