public void OnRecordPersistentData() { Target = GetComponent <LightProp>(); VariableName = "Light" + transform.position.x + transform.position.y; DialogueLua.SetVariable(VariableName + "On", Target.On); DialogueLua.SetVariable(VariableName + "Intensity", Target.TargetIntensity); }
public void OnApplyPersistentData() { Target = GetComponent <LightProp>(); VariableName = "Light" + transform.position.x + transform.position.y; if (DialogueLua.DoesVariableExist(VariableName + "On")) { Target.On = DialogueLua.GetVariable(VariableName + "On").asBool; Target.TargetIntensity = DialogueLua.GetVariable(VariableName + "Intensity").asFloat; if (Target.On) { Target.SetOn(); } else { Target.SetOff(); } } }
void Start() { Target = GetComponent <LightProp>(); VariableName = "Light" + transform.position.x + transform.position.y; }