void Update() { if (inTrigger == true && Input.GetKeyDown(KeyCode.E) && platform.IsStationary() == true) { platform.MovePlatform(); } }
void MoveSwitch() { if (!on) { anim["SwitchDown"].time = 0; anim["SwitchDown"].speed = 1; on = true; movePlatform.MovePlatform(); } else { Debug.Log("detect on"); anim["SwitchDown"].time = anim["SwitchDown"].length; anim["SwitchDown"].speed = -1; on = false; movePlatform.StopPlatform(); } anim.Play(); }