클라이언트에서 캠프 처치 없이도 ResourcePickup이 보이는 문제 수정
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user