Worker 상호작용에 Cost 요구사항 제거
This commit is contained in:
@@ -75,7 +75,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
|
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
|
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
|
||||||
GlobalObjectIdHash: 1475696401
|
GlobalObjectIdHash: 4213269672
|
||||||
InScenePlacedSourceGlobalObjectIdHash: 0
|
InScenePlacedSourceGlobalObjectIdHash: 0
|
||||||
DeferredDespawnTick: 0
|
DeferredDespawnTick: 0
|
||||||
Ownership: 1
|
Ownership: 1
|
||||||
@@ -106,7 +106,6 @@ MonoBehaviour:
|
|||||||
followDistance: 5
|
followDistance: 5
|
||||||
movementSpeed: 5
|
movementSpeed: 5
|
||||||
resourcesPerMining: 5
|
resourcesPerMining: 5
|
||||||
recruitmentCost: 250
|
|
||||||
interactionAnimationTrigger:
|
interactionAnimationTrigger:
|
||||||
miningEffectPrefab: {fileID: 0}
|
miningEffectPrefab: {fileID: 0}
|
||||||
depositEffectPrefab: {fileID: 0}
|
depositEffectPrefab: {fileID: 0}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ namespace Northbound
|
|||||||
public float followDistance = 3f;
|
public float followDistance = 3f;
|
||||||
public float movementSpeed = 3.5f;
|
public float movementSpeed = 3.5f;
|
||||||
public int resourcesPerMining = 5;
|
public int resourcesPerMining = 5;
|
||||||
public int recruitmentCost = 10;
|
|
||||||
|
|
||||||
[Header("Interaction")]
|
[Header("Interaction")]
|
||||||
public string interactionAnimationTrigger = "Recruit";
|
public string interactionAnimationTrigger = "Recruit";
|
||||||
@@ -373,13 +372,6 @@ namespace Northbound
|
|||||||
if (_ownerPlayerId.Value != ulong.MaxValue && _ownerPlayerId.Value != playerId)
|
if (_ownerPlayerId.Value != ulong.MaxValue && _ownerPlayerId.Value != playerId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_ownerPlayerId.Value == ulong.MaxValue)
|
|
||||||
{
|
|
||||||
var coreResourceManager = CoreResourceManager.Instance;
|
|
||||||
if (coreResourceManager != null && !coreResourceManager.CanAfford(recruitmentCost))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,20 +400,6 @@ namespace Northbound
|
|||||||
[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)]
|
[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)]
|
||||||
private void RecruitWorkerServerRpc(ulong playerId, ulong workerNetObjectId)
|
private void RecruitWorkerServerRpc(ulong playerId, ulong workerNetObjectId)
|
||||||
{
|
{
|
||||||
var coreResourceManager = CoreResourceManager.Instance;
|
|
||||||
if (coreResourceManager == null)
|
|
||||||
{
|
|
||||||
Debug.LogWarning("[Worker] CoreResourceManager 인스턴스를 찾을 수 없습니다.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!coreResourceManager.CanAfford(recruitmentCost))
|
|
||||||
{
|
|
||||||
Debug.LogWarning($"[Worker] 코어 자원이 부족합니다. 필요: {recruitmentCost}");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
coreResourceManager.SpendResources(recruitmentCost);
|
|
||||||
_ownerPlayerId.Value = playerId;
|
_ownerPlayerId.Value = playerId;
|
||||||
SetState(WorkerState.Following);
|
SetState(WorkerState.Following);
|
||||||
UpdatePlayerTransform();
|
UpdatePlayerTransform();
|
||||||
@@ -463,11 +441,7 @@ namespace Northbound
|
|||||||
{
|
{
|
||||||
if (_ownerPlayerId.Value == ulong.MaxValue)
|
if (_ownerPlayerId.Value == ulong.MaxValue)
|
||||||
{
|
{
|
||||||
var coreResourceManager = CoreResourceManager.Instance;
|
return "[E] Recruit Worker";
|
||||||
if (coreResourceManager != null && !coreResourceManager.CanAfford(recruitmentCost))
|
|
||||||
return $"Resource Required: {recruitmentCost})";
|
|
||||||
|
|
||||||
return $"[E] Recruit Worker: {recruitmentCost}";
|
|
||||||
}
|
}
|
||||||
else if (NetworkManager.Singleton != null && _ownerPlayerId.Value == NetworkManager.Singleton.LocalClientId)
|
else if (NetworkManager.Singleton != null && _ownerPlayerId.Value == NetworkManager.Singleton.LocalClientId)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user