void Start() { platform = GetComponent <vp_MovingPlatform>(); if (State == null) { throw new MissingReferenceException("Missing ToggleState Reference"); } platform.GoTo(State.RuntimeValue); index = State.RuntimeValue; }
void Update() { if (toggleState == null) { throw new MissingReferenceException("Missing ToggleState Reference"); } if (lastState == toggleState.RuntimeValue) { return; } if (toggleState.RuntimeValue) { platform.GoTo(1); } else { platform.GoTo(0); } lastState = toggleState.RuntimeValue; }
void Update() { if (State == null) { throw new MissingReferenceException("Missing ToggleState Reference"); } if (index == State.RuntimeValue) { return; } platform.GoTo(State.RuntimeValue); index = State.RuntimeValue; }