Пример #1
0
 public override void onUpdate(PlayerFSM FSM)
 {
     print("Idle");
     if (Input.GetKey(ButtonConfig.key.jump))
     {
         FSM.SetState(FSM.JumpState);
     }
     if (Input.GetKey(ButtonConfig.key.left) || Input.GetKey(ButtonConfig.key.right))
     {
         FSM.SetState(FSM.RunState);
     }
 }
Пример #2
0
 public override void onUpdate(PlayerFSM FSM)
 {
     print("Jump");
     CheckGrounded();
     if (isGrounded)
     {
         FSM.SetState(FSM.IdleState);
     }
 }