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 TransformArrayclass 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.