기존 시스템 재사용 프로토타입 보존
This commit is contained in:
@@ -10,6 +10,8 @@ public class NetworkPlayerController : NetworkBehaviour, ITeamMember, IDamageabl
|
||||
{
|
||||
[Header("Movement Settings")]
|
||||
public float rotationSpeed = 10f;
|
||||
[Tooltip("공격 애니메이션 중 이동을 막을지 여부")]
|
||||
public bool blockMovementDuringAttack = true;
|
||||
|
||||
[Header("Team Settings")]
|
||||
[SerializeField] private TeamType initialTeam = TeamType.Player;
|
||||
@@ -21,6 +23,7 @@ public class NetworkPlayerController : NetworkBehaviour, ITeamMember, IDamageabl
|
||||
[Header("Death Settings")]
|
||||
[SerializeField] private GameObject resourcePickupPrefab; // 자원 드랍 프리팹
|
||||
[SerializeField] private float respawnDelay = 10f; // 부활 대기 시간 (초)
|
||||
[SerializeField] private bool dropResourcesOnDeath = true;
|
||||
|
||||
[Header("Health Bar")]
|
||||
[SerializeField] private bool showHealthBar = true;
|
||||
@@ -61,9 +64,18 @@ public class NetworkPlayerController : NetworkBehaviour, ITeamMember, IDamageabl
|
||||
// 이 플레이어가 로컬 플레이어인지 확인
|
||||
|
||||
|
||||
public new bool IsLocalPlayer => _ownerPlayerId.Value == NetworkManager.Singleton.LocalClientId;
|
||||
public new bool IsLocalPlayer => NetworkManager.Singleton != null &&
|
||||
(_ownerPlayerId.Value == ulong.MaxValue ? OwnerClientId : _ownerPlayerId.Value) == NetworkManager.Singleton.LocalClientId;
|
||||
|
||||
public ulong OwnerPlayerId => _ownerPlayerId.Value;
|
||||
public ulong OwnerPlayerId => _ownerPlayerId.Value == ulong.MaxValue ? OwnerClientId : _ownerPlayerId.Value;
|
||||
public Vector3 ServerMoveDirection => new Vector3(_serverMoveInput.x, 0f, _serverMoveInput.y).normalized;
|
||||
|
||||
public void ConfigurePrototypeMode()
|
||||
{
|
||||
blockMovementDuringAttack = false;
|
||||
dropResourcesOnDeath = false;
|
||||
respawnDelay = 3f;
|
||||
}
|
||||
|
||||
// 중앙 집중식 입력 관리 - 다른 컴포넌트에서 참조
|
||||
public PlayerInputActions InputActions => _inputActions;
|
||||
@@ -89,6 +101,10 @@ public class NetworkPlayerController : NetworkBehaviour, ITeamMember, IDamageabl
|
||||
// 서버에서 초기화
|
||||
if (IsServer)
|
||||
{
|
||||
if (_ownerPlayerId.Value == ulong.MaxValue)
|
||||
{
|
||||
_ownerPlayerId.Value = OwnerClientId;
|
||||
}
|
||||
if (_team.Value == TeamType.Neutral)
|
||||
{
|
||||
_team.Value = initialTeam;
|
||||
@@ -245,7 +261,7 @@ public class NetworkPlayerController : NetworkBehaviour, ITeamMember, IDamageabl
|
||||
var attackAction = GetComponent<AttackAction>();
|
||||
var playerInteraction = GetComponent<PlayerInteraction>();
|
||||
|
||||
bool isActionBlocked = (attackAction != null && attackAction.IsAttacking) ||
|
||||
bool isActionBlocked = (blockMovementDuringAttack && attackAction != null && attackAction.IsAttacking) ||
|
||||
(playerInteraction != null && playerInteraction.IsInteracting);
|
||||
|
||||
if (isActionBlocked)
|
||||
@@ -420,7 +436,10 @@ public class NetworkPlayerController : NetworkBehaviour, ITeamMember, IDamageabl
|
||||
if (!IsServer) return;
|
||||
|
||||
// 플레이어가 가진 자원을 ResourcePickup으로 드랍
|
||||
DropPlayerResources();
|
||||
if (dropResourcesOnDeath)
|
||||
{
|
||||
DropPlayerResources();
|
||||
}
|
||||
|
||||
// 사망 이펙트
|
||||
ShowDeathEffectClientRpc();
|
||||
|
||||
Reference in New Issue
Block a user