플레이어의 최대 자원이 플레이어에 정의한 값을 사용하도록 함
50으로 설정해도 100으로 작동하는 문제가 해결됨
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user