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); } }