예제 #1
0
 void Update()
 {
     if (inTrigger == true && Input.GetKeyDown(KeyCode.E) && platform.IsStationary() == true)
     {
         platform.MovePlatform();
     }
 }
예제 #2
0
 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();
 }