2026-04-01 상호작용

This commit is contained in:
2026-04-01 18:05:42 +09:00
parent 902b1b76fb
commit 4cbd9787b8
11 changed files with 89 additions and 17 deletions

View File

@@ -57,13 +57,13 @@ public void SetMaxJumpCount(int maxCount)
#region
//지상 이동이 가능한가?
public bool CanMove() => IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run) && (CurrentState != PlayerState.Inertia);
public bool CanMove() => IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run) && (CurrentState != PlayerState.Inertia && CurrentState != PlayerState.Action && CurrentState != PlayerState.Trans);
//점프가 가능한 상태인가?
public bool CanJump()
{
bool jumpAlreadyMax = (_maxJumpCount <= _jumpCount);
return IsGrounded && !IsMoveCut && !jumpAlreadyMax && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run) && (CurrentState != PlayerState.Inertia);
return IsGrounded && !IsMoveCut && !jumpAlreadyMax && (CurrentState == PlayerState.Idle || CurrentState == PlayerState.Walk || CurrentState == PlayerState.Run) && (CurrentState != PlayerState.Inertia && CurrentState != PlayerState.Action && CurrentState != PlayerState.Trans);
}
//대쉬가 가능한 상태인가?
public bool CanDodge()
@@ -79,6 +79,8 @@ public bool CanDodge()
if (IsMoveCut) return false;
if (CurrentState == PlayerState.Inertia) return false;
if (CurrentState == PlayerState.Action) return false;
if (CurrentState == PlayerState.Trans) return false;
// 스태미나 시스템이 있다면 체크
// if (CurrentStamina < DodgeCost) return false;
@@ -86,7 +88,7 @@ public bool CanDodge()
return true;
}
//공중에서 조작 가능한 상태인가?
public bool CanControlInAir() => !IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Jump || CurrentState == PlayerState.Fall) && (CurrentState != PlayerState.Inertia);
public bool CanControlInAir() => !IsGrounded && !IsMoveCut && (CurrentState == PlayerState.Jump || CurrentState == PlayerState.Fall) && (CurrentState != PlayerState.Inertia && CurrentState != PlayerState.Action && CurrentState != PlayerState.Trans);
//공격이 가능한 상태인가?
public bool CanAttack()
{
@@ -101,6 +103,9 @@ public bool CanAttack()
if (CurrentState == PlayerState.Dodge || CurrentState == PlayerState.Inertia)
return false;
if (CurrentState == PlayerState.Action || CurrentState == PlayerState.Trans)
return false;
// (Idle, Walk, Run, Jump, Fall 상태에서 공격 가능)
return true;
}