update di chuyển debug jump
This commit is contained in:
@@ -25,14 +25,14 @@ namespace OnlyScove.Scripts
|
||||
|
||||
public override void Enter()
|
||||
{
|
||||
// Sử dụng dữ liệu đồng bộ
|
||||
Vector2 input = stateMachine.MoveInput;
|
||||
Debug.Log("<color=yellow>[PlayerJumpState]</color> Entered Jump State");
|
||||
|
||||
stateMachine.Anim.ResetTrigger(jumpHash);
|
||||
stateMachine.Anim.SetTrigger(jumpHash);
|
||||
stateMachine.AnimationHandler.SafeResetTrigger(jumpHash);
|
||||
stateMachine.AnimationHandler.SafeSetTrigger(jumpHash);
|
||||
stateMachine.AnimationHandler.SafeSetBool("IsJumping", true);
|
||||
|
||||
// Physic formula: v = sqrt(h * -2 * g)
|
||||
stateMachine.VelocityY = Mathf.Sqrt(stateMachine.JumpHeight * -2f * stateMachine.Gravity);
|
||||
// Sử dụng hàm Jump tập trung để đồng bộ vật lý và cooldown
|
||||
stateMachine.Movement.Jump();
|
||||
|
||||
stateMachine.Input.OnSprintEvent += OnAirDash;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user