2026-03-13 점프 기능 수정중
This commit is contained in:
@@ -83,6 +83,7 @@ private void Update()
|
||||
WorkGravity();
|
||||
ApplyVelocity();
|
||||
|
||||
TickTimer();
|
||||
//PlayerDebug();
|
||||
}
|
||||
|
||||
@@ -113,6 +114,7 @@ private void WorkGravity()
|
||||
|
||||
_velocityY.y += _gravityValue * Time.deltaTime;
|
||||
_anim.SetFloat("velocityY", _velocityY.y);
|
||||
_anim.SetBool("IsGrounded", _stateMachine.IsGrounded);
|
||||
|
||||
// 상태 자동 전환 로직
|
||||
if (!_stateMachine.IsGrounded && _stateMachine.CurrentState != PlayerState.Jump && _stateMachine.CurrentState != PlayerState.Attack && _stateMachine.CurrentState != PlayerState.Charge)
|
||||
@@ -271,7 +273,7 @@ public void JumpInput(InputState inputState)
|
||||
_anim.SetTrigger("jumpTrigger");
|
||||
_stateMachine.ChangeState(PlayerState.Jump);
|
||||
_jumpReadyCoolTimer = _jumpReadyCool;
|
||||
_ = Util.RunDelayed(0.7f, JumpAction, default);
|
||||
_ = Util.RunDelayed(0.1f, JumpAction, default);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,4 +282,11 @@ private void JumpAction()
|
||||
_velocityY.y = Mathf.Sqrt(_jumpPower * -2f * _gravityValue);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region
|
||||
private void TickTimer()
|
||||
{
|
||||
if (_jumpReadyCoolTimer > 0) _jumpReadyCoolTimer -= Time.deltaTime; if (_jumpReadyCoolTimer < 0) _jumpReadyCoolTimer = 0f;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user