Esempio n. 1
0
        public override void OnUpdate(PlayerMovement playerMovement)
        {
            if (PlayerInputManager.Instance.HasMovementInput)
            {
                playerMovement.TransitionTo(_walkState);
            }

            if (PlayerInputManager.Instance.PressDash)
            {
                playerMovement.TransitionTo(_dashState);
            }
        }
Esempio n. 2
0
 public override void OnFixedUpdate(PlayerMovement playerMovement)
 {
     if (!playerMovement.Controller.IsMoving())
     {
         playerMovement.TransitionTo(_idleState);
     }
 }
Esempio n. 3
0
        public override void OnUpdate(PlayerMovement playerMovement)
        {
            playerMovement.Controller.Run();
            playerMovement.Animation.UpdateDirection();

            if (PlayerInputManager.Instance.ReleaseDash)
            {
                if (playerMovement.Controller.IsMoving())
                {
                    playerMovement.TransitionTo(_walkState);
                }
                else
                {
                    playerMovement.TransitionTo(_idleState);
                }
            }
        }
Esempio n. 4
0
 private void Transition(PlayerMovement playerMovement)
 {
     if (PlayerInputManager.Instance.HasMovementInput)
     {
         if (_hasReleasedButton)
         {
             playerMovement.TransitionTo(_walkState);
         }
         else
         {
             playerMovement.TransitionTo(_sprintState);
         }
     }
     else
     {
         playerMovement.TransitionTo(_idleState);
     }
 }
Esempio n. 5
0
        public override void OnUpdate(PlayerMovement playerMovement)
        {
            playerMovement.Controller.Walk();
            playerMovement.Animation.UpdateDirection();

            if (PlayerInputManager.Instance.PressDash)
            {
                playerMovement.TransitionTo(_dashState);
            }
        }