클라이언트에서 캠프 처치 없이도 ResourcePickup이 보이는 문제 수정

This commit is contained in:
2026-02-25 23:52:13 +09:00
parent 72fe5e5b04
commit a4eae438de
2 changed files with 71 additions and 21 deletions

View File

@@ -203,8 +203,8 @@ namespace Northbound
networkObj.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId);
// 비활성화는 ServerRpc를 통해 처리
DisablePickupClientRpc();
// NetworkVariable을 통해 가시성 동기화 (기본적으로 숨김)
_resourcePickup.SetVisible(false);
}
private void HandleCreepDeath(EnemyUnit deadCreep)
@@ -225,7 +225,8 @@ namespace Northbound
// 모든 creep이 처치되었으면 ResourcePickup 활성화
if (_spawnedCreeps.Count == 0 && _resourcePickup != null)
{
EnableResourcePickupClientRpc();
// NetworkVariable이 자동으로 클라이언트에 동기화됨
_resourcePickup.SetVisible(true);
}
}
@@ -262,24 +263,6 @@ namespace Northbound
}
}
[Rpc(SendTo.ClientsAndHost)]
private void EnableResourcePickupClientRpc()
{
if (_resourcePickup != null)
{
_resourcePickup.gameObject.SetActive(true);
}
}
[Rpc(SendTo.ClientsAndHost)]
private void DisablePickupClientRpc()
{
if (_resourcePickup != null)
{
_resourcePickup.gameObject.SetActive(false);
}
}
private CreepData GetCreepDataFromPrefab(GameObject prefab)
{
if (prefab == null) return null;