public void OnUpdate(SimplePlayerController fsm)
 {
     if (fsm.IsGrounded())
     {
         // transition back to idle when back on ground
         fsm.Transition(SimplePlayerController.IdleState);
     }
 }
Esempio n. 2
0
 public void OnUpdate(SimplePlayerController fsm)
 {
     if (fsm.IsGrounded())
     {
         // transition back to idle when back on ground
         fsm.Transition(SimplePlayerController.IdleState);
     }
 }
 public void OnUpdate(SimplePlayerController fsm)
 {
     if (Mathf.Abs(Input.GetAxis("Horizontal")) < 0.0001f)
     {
         fsm.Transition(SimplePlayerController.IdleState);
     }
     if (Input.GetButtonDown("Jump") && fsm.IsGrounded())
     {
         fsm.Transition(SimplePlayerController.JumpState);
     }
 }
 public void OnUpdate(SimplePlayerController fsm)
 {
     if (Mathf.Abs(Input.GetAxis("Horizontal")) < 0.0001f)
     {
         fsm.Transition(SimplePlayerController.IdleState);
     }
     if (Input.GetButtonDown("Jump") && fsm.IsGrounded())
     {
         fsm.Transition(SimplePlayerController.JumpState);
     }
 }