Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

TransformVariable

sophia daniels edited this page Oct 4, 2018 · 1 revision

Implements: ScriptableObject > SavableVariable, ISerializationCallbackReceiver

Description

ScriptableObject for saving and sharing transform data

Properties

Vector3 InitialPosition

The default position for the variable

Vector3 InitialRotaion

The default rotation for the variable

Vector3 InitialScale

The default scale for the variable

Vector3 RuntimePosition

The run time position for the variable

Vector3 RuntimeRotaion

The run time rotation for the variable

Vector3 RunetimeScale

The run time scale for the variable

Transform RuntimeValue { set;}

Run time value for the variable

SavableVariable Properties

bool Loaded

Set to true if data has been loaded


void OnAfterDeserialize

Applies the default value to the run time value after deserialization.

  • This should happen after changing the default values in the inspector. It will also apply the default value when the game starts.
  • Required for ISerializationCallbackReceiver

void OnBeforeSerialize()

Does nothing

  • Required for ISerializationCallbackReceiver

void OnClearSave()

Clear the saved data

string OnSaveData()

Converts runtime data to a string to be saved

  • Returns: String of runtime data

void OnLoadData(string data)

Parses string of data into runtime data

  • Param: data - Data to be loaded

Clone this wiki locally