2026-03-20 : 8방향 대시
This commit is contained in:
@@ -57,13 +57,13 @@ public void SetMaxJumpCount(int maxCount)
|
||||
|
||||
#region 상태확인용 헬퍼함수들
|
||||
//지상 이동이 가능한가?
|
||||
public bool CanMove() => IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run);
|
||||
public bool CanMove() => IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run) && (CurrentState != PlayerState.Inertia);
|
||||
//점프가 가능한 상태인가?
|
||||
public bool CanJump()
|
||||
{
|
||||
bool jumpAlreadyMax = (_maxJumpCount <= _jumpCount);
|
||||
|
||||
return IsGrounded && !IsMoveCut && !jumpAlreadyMax && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run);
|
||||
return IsGrounded && !IsMoveCut && !jumpAlreadyMax && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run) && (CurrentState != PlayerState.Inertia);
|
||||
}
|
||||
//대쉬가 가능한 상태인가?
|
||||
public bool CanDodge()
|
||||
@@ -78,6 +78,7 @@ public bool CanDodge()
|
||||
if (CurrentState == PlayerState.Hit || CurrentState == PlayerState.Dead) return false;
|
||||
|
||||
if (IsMoveCut) return false;
|
||||
if (CurrentState == PlayerState.Inertia) return false;
|
||||
|
||||
// 스태미나 시스템이 있다면 체크
|
||||
// if (CurrentStamina < DodgeCost) return false;
|
||||
@@ -85,7 +86,7 @@ public bool CanDodge()
|
||||
return true;
|
||||
}
|
||||
//공중에서 조작 가능한 상태인가?
|
||||
public bool CanControlInAir() => !IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Jump || CurrentState == PlayerState.Fall);
|
||||
public bool CanControlInAir() => !IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Jump || CurrentState == PlayerState.Fall) && (CurrentState != PlayerState.Inertia);
|
||||
//공격이 가능한 상태인가?
|
||||
public bool CanAttack()
|
||||
{
|
||||
@@ -97,6 +98,9 @@ public bool CanAttack()
|
||||
if (CurrentState == PlayerState.Hit || CurrentState == PlayerState.Dead)
|
||||
return false;
|
||||
|
||||
if (CurrentState == PlayerState.Dodge || CurrentState == PlayerState.Inertia)
|
||||
return false;
|
||||
|
||||
// (Idle, Walk, Run, Jump, Fall 상태에서 공격 가능)
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user