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