건축 및 고용에 비용 소모 기능 추가

This commit is contained in:
2026-02-02 20:26:44 +09:00
parent 9dea9daaa9
commit 958ae1cb75
6 changed files with 159 additions and 11 deletions

View File

@@ -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)
{