건축 및 고용에 비용 소모 기능 추가
This commit is contained in:
@@ -193,6 +193,22 @@ namespace Northbound
|
||||
return;
|
||||
}
|
||||
|
||||
// 자원 확인 및 소비
|
||||
var coreResourceManager = CoreResourceManager.Instance;
|
||||
if (coreResourceManager == null)
|
||||
{
|
||||
Debug.LogWarning("<color=red>[BuildingManager] CoreResourceManager 인스턴스를 찾을 수 없습니다.</color>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!coreResourceManager.CanAfford(data.mana))
|
||||
{
|
||||
Debug.LogWarning($"<color=yellow>[BuildingManager] 코어 자원이 부족합니다. 필요: {data.mana} (클라이언트: {requestingClientId})</color>");
|
||||
return;
|
||||
}
|
||||
|
||||
coreResourceManager.SpendResources(data.mana);
|
||||
|
||||
// 배치 가능 여부 확인
|
||||
if (!IsValidPlacement(data, position, rotation, out Vector3 snappedPosition))
|
||||
{
|
||||
@@ -345,6 +361,22 @@ namespace Northbound
|
||||
return;
|
||||
}
|
||||
|
||||
// 자원 확인 및 소비
|
||||
var coreResourceManager = CoreResourceManager.Instance;
|
||||
if (coreResourceManager == null)
|
||||
{
|
||||
Debug.LogWarning("<color=red>[BuildingManager] CoreResourceManager 인스턴스를 찾을 수 없습니다.</color>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!coreResourceManager.CanAfford(data.mana))
|
||||
{
|
||||
Debug.LogWarning($"<color=yellow>[BuildingManager] 코어 자원이 부족합니다. 필요: {data.mana}</color>");
|
||||
return;
|
||||
}
|
||||
|
||||
coreResourceManager.SpendResources(data.mana);
|
||||
|
||||
// 토대 프리팹 확인
|
||||
if (foundationPrefab == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user