액션 및 인터랙션 시 장비를 착용할 수 있도록 함. 코드 개선 추가
This commit is contained in:
@@ -101,6 +101,23 @@ public class NetworkPlayerController : NetworkBehaviour, ITeamMember, IDamageabl
|
||||
// 죽었으면 이동 불가
|
||||
if (_currentHealth.Value <= 0) return;
|
||||
|
||||
// 액션/상호작용 중이면 이동 불가
|
||||
var attackAction = GetComponent<AttackAction>();
|
||||
var playerInteraction = GetComponent<PlayerInteraction>();
|
||||
|
||||
bool isActionBlocked = (attackAction != null && attackAction.IsAttacking) ||
|
||||
(playerInteraction != null && playerInteraction.IsInteracting);
|
||||
|
||||
if (isActionBlocked)
|
||||
{
|
||||
// 이동 불가 시 애니메이션 속도를 0으로
|
||||
if (_animator != null)
|
||||
{
|
||||
_animator.SetFloat("MoveSpeed", 0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
_moveInput = _inputActions.Player.Move.ReadValue<Vector2>();
|
||||
Vector3 move = new Vector3(_moveInput.x, 0, _moveInput.y).normalized;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user