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

            if (PlayerInputManager.Instance.PressDash)
            {
                playerMovement.TransitionTo(_dashState);
            }
        }
예제 #2
0
 public override void OnFixedUpdate(PlayerMovement playerMovement)
 {
     if (!playerMovement.Controller.IsMoving())
     {
         playerMovement.TransitionTo(_idleState);
     }
 }
예제 #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);
                }
            }
        }
예제 #4
0
 private void Transition(PlayerMovement playerMovement)
 {
     if (PlayerInputManager.Instance.HasMovementInput)
     {
         if (_hasReleasedButton)
         {
             playerMovement.TransitionTo(_walkState);
         }
         else
         {
             playerMovement.TransitionTo(_sprintState);
         }
     }
     else
     {
         playerMovement.TransitionTo(_idleState);
     }
 }
예제 #5
0
        public override void OnUpdate(PlayerMovement playerMovement)
        {
            playerMovement.Controller.Walk();
            playerMovement.Animation.UpdateDirection();

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