Skip to main content

SaveableTransform

An abstract class in Root.Township, the global namespace.

Base ScriptableObject for assets that store a transform's state and can apply it again. Subclasses are TransformSaveObject and TransformSaveCollection.

Constructors​

MemberWhat it is
protected SaveableTransform()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Methods​

MemberWhat it is
static ScriptableObject CreateObject<T>(Transform transform, bool isLocalSave, string savePath)Creates a new instance of the given subclass. The transform, flag and path are ignored here.
abstract bool LoadInto(Transform transform)Applies the stored state to a transform. Returns whether it worked.
abstract void Save(Transform transform, bool isLocalSave)Stores a transform's state, in local or world space.