건설 모드에서 클릭이 잘 작동하지 않는 문제 수정

건설 모드 UI가 클릭되어 건설되지 않는 문제 수정
JMO Asset 위치 조정
Tower, Monster, Creep의 Hit/Destroy FX Prefab 설정 (Template Level)
Tower에 체력바 추가 (최초 건설 시, 체력 변경 시 등장)
Tower 관련 디버깅 로그 정리
건설 토대의 사이즈가 비정상적인 문제 수정
This commit is contained in:
2026-02-25 01:41:58 +09:00
parent 3dabf9f9a4
commit f3923079a4
1047 changed files with 897 additions and 373 deletions

View File

@@ -89,7 +89,9 @@ namespace Northbound
// Ground check
if (!CheckGround(position, out groundPosition))
{
return false;
}
// IMPORTANT: Snap to grid BEFORE checking overlap!
// Otherwise we check the raw cursor position which might overlap
@@ -119,7 +121,9 @@ namespace Northbound
Bounds buildingGridBounds = building.GetGridBounds();
if (checkBounds.Intersects(buildingGridBounds))
{
return false;
}
}
// 토대와의 충돌 체크
@@ -130,7 +134,9 @@ namespace Northbound
Bounds foundationGridBounds = foundation.GetGridBounds();
if (checkBounds.Intersects(foundationGridBounds))
{
return false;
}
}
// 물리적 충돌 체크 (플레이어, 유닛, 기타 오브젝트와의 충돌)
@@ -197,14 +203,12 @@ namespace Northbound
// 보안 검증 1: 유효한 클라이언트인지 확인
if (!NetworkManager.Singleton.ConnectedClients.ContainsKey(requestingClientId))
{
Debug.LogWarning($"<color=red>[BuildingManager] 유효하지 않은 클라이언트 ID: {requestingClientId}</color>");
return;
}
// 보안 검증 2: 건물 인덱스 유효성 확인
if (buildingIndex < 0 || buildingIndex >= availableBuildings.Count)
{
Debug.LogWarning($"<color=red>[BuildingManager] 유효하지 않은 건물 인덱스: {buildingIndex} (클라이언트: {requestingClientId})</color>");
return;
}
@@ -213,7 +217,6 @@ namespace Northbound
// 보안 검증 3: 건물 데이터 유효성 확인
if (data == null || data.prefab == null)
{
Debug.LogWarning($"<color=red>[BuildingManager] 건물 데이터가 유효하지 않습니다. (클라이언트: {requestingClientId})</color>");
return;
}
@@ -221,13 +224,11 @@ namespace Northbound
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;
}
@@ -236,7 +237,6 @@ namespace Northbound
// 배치 가능 여부 확인
if (!IsValidPlacement(data, position, rotation, out Vector3 snappedPosition))
{
Debug.LogWarning($"<color=yellow>[BuildingManager] 건물 배치 불가능 위치 (클라이언트: {requestingClientId})</color>");
return;
}
@@ -268,8 +268,6 @@ namespace Northbound
// 건물 초기화
building.Initialize(data, gridPosition, rotation, requestingClientId);
placedBuildings.Add(building);
Debug.Log($"<color=green>[BuildingManager] {data.buildingName} 건설 완료 (소유자: {requestingClientId}, 위치: {gridPosition})</color>");
}
else
{
@@ -283,7 +281,6 @@ namespace Northbound
if (placedBuildings.Contains(building))
{
placedBuildings.Remove(building);
Debug.Log($"<color=yellow>[BuildingManager] 건물 제거됨: {building.buildingData?.buildingName ?? "Unknown"}</color>");
}
}
@@ -295,7 +292,6 @@ namespace Northbound
if (placedFoundations.Contains(foundation))
{
placedFoundations.Remove(foundation);
Debug.Log($"<color=yellow>[BuildingManager] 토대 제거됨: {foundation.buildingData?.buildingName ?? "Unknown"}</color>");
}
}
@@ -307,7 +303,6 @@ namespace Northbound
if (!placedBuildings.Contains(building))
{
placedBuildings.Add(building);
Debug.Log($"<color=cyan>[BuildingManager] 사전 배치 건물 등록: {building.buildingData?.buildingName ?? building.gameObject.name}</color>");
}
}
@@ -365,14 +360,12 @@ namespace Northbound
// 보안 검증 1: 유효한 클라이언트인지 확인
if (!NetworkManager.Singleton.ConnectedClients.ContainsKey(requestingClientId))
{
Debug.LogWarning($"<color=red>[BuildingManager] 유효하지 않은 클라이언트 ID: {requestingClientId}</color>");
return;
}
// 보안 검증 2: 건물 인덱스 유효성 확인
if (buildingIndex < 0 || buildingIndex >= availableBuildings.Count)
{
Debug.LogWarning($"<color=red>[BuildingManager] 유효하지 않은 건물 인덱스: {buildingIndex}</color>");
return;
}
@@ -381,7 +374,6 @@ namespace Northbound
// 보안 검증 3: 건물 데이터 유효성 확인
if (data == null)
{
Debug.LogWarning($"<color=red>[BuildingManager] 건물 데이터가 유효하지 않습니다.</color>");
return;
}
@@ -389,13 +381,11 @@ namespace Northbound
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;
}
@@ -411,7 +401,8 @@ namespace Northbound
// 배치 가능 여부 확인
if (!IsValidPlacement(data, position, rotation, out Vector3 snappedPosition))
{
Debug.LogWarning($"<color=yellow>[BuildingManager] 토대 배치 불가능 위치</color>");
// 자원 환불
coreResourceManager.AddResources(data.mana);
return;
}
@@ -523,8 +514,6 @@ namespace Northbound
// 건물 초기화
building.Initialize(data, gridPosition, rotation, ownerId);
placedBuildings.Add(building);
Debug.Log($"<color=green>[BuildingManager] {data.buildingName} 건설 완료! (소유자: {ownerId}, 위치: {gridPosition}, 팀: {team})</color>");
}
else
{