플레이어의 최대 자원이 플레이어에 정의한 값을 사용하도록 함

50으로 설정해도 100으로 작동하는 문제가 해결됨
This commit is contained in:
2026-02-04 11:18:54 +09:00
parent 965a4a25aa
commit c74d6d2ebd
4 changed files with 38 additions and 8 deletions

View File

@@ -11,10 +11,21 @@ namespace Northbound
public int CurrentResourceAmount => _displayAmount;
public int MaxResourceCapacity => maxResourceCapacity;
[Rpc(SendTo.Server)]
private void SetMaxCapacityServerRpc(int maxCapacity)
{
var resourceManager = ServerResourceManager.Instance;
if (resourceManager != null)
{
resourceManager.SetPlayerMaxCapacity(OwnerClientId, maxCapacity);
}
}
public override void OnNetworkSpawn()
{
if (IsClient && IsOwner)
{
SetMaxCapacityServerRpc(maxResourceCapacity);
RequestResourceUpdateServerRpc();
}
}