디버깅용 로그 제거

This commit is contained in:
2026-01-30 16:14:41 +09:00
parent e9cebeedf0
commit 8c7c82e984
8 changed files with 21 additions and 124 deletions

View File

@@ -88,7 +88,7 @@ namespace Northbound
if (useInitialOwner && _ownerId.Value == 0)
{
_ownerId.Value = initialOwnerId;
Debug.Log($"<color=cyan>[Building] 사전 배치 건물 '{buildingData?.buildingName ?? gameObject.name}' 소유자: {initialOwnerId}, 팀: {_team.Value}</color>");
// Debug.Log($"<color=cyan>[Building] 사전 배치 건물 '{buildingData?.buildingName ?? gameObject.name}' 소유자: {initialOwnerId}, 팀: {_team.Value}</color>");
}
else if (!useInitialOwner && _ownerId.Value == 0)
{

View File

@@ -92,7 +92,7 @@ namespace Northbound
{
int slotIndex = i; // 클로저 캡처를 위한 로컬 변수
_quickslotActions[i].performed += ctx => OnQuickslotPressed(slotIndex);
Debug.Log($"[BuildingQuickslotUI] QuickSlot{i + 1} 액션 바인딩 성공");
// Debug.Log($"[BuildingQuickslotUI] QuickSlot{i + 1} 액션 바인딩 성공");
}
else
{

View File

@@ -92,7 +92,7 @@ namespace Northbound.Editor
[MenuItem("Tools/Fog of War/Add Visibility to Scene Obstacles")]
public static void AddVisibilityToSceneObstacles()
{
GameObject[] allObjects = GameObject.FindObjectsOfType<GameObject>();
GameObject[] allObjects = GameObject.FindObjectsByType<GameObject>(FindObjectsSortMode.None);
int count = 0;
foreach (GameObject obj in allObjects)
@@ -153,7 +153,7 @@ namespace Northbound.Editor
}
// Remove from scene objects
FogOfWarVisibility[] sceneComponents = GameObject.FindObjectsOfType<FogOfWarVisibility>();
FogOfWarVisibility[] sceneComponents = GameObject.FindObjectsByType<FogOfWarVisibility>(FindObjectsSortMode.None);
int sceneCount = sceneComponents.Length;
foreach (var comp in sceneComponents)

View File

@@ -298,7 +298,7 @@ namespace Northbound
if (!_visionProviders.Contains(provider))
{
_visionProviders.Add(provider);
Debug.Log($"<color=cyan>[FogOfWar] Vision Provider 등록: {provider.GetTransform().name} (Owner: {provider.GetOwnerId()})</color>");
// Debug.Log($"<color=cyan>[FogOfWar] Vision Provider 등록: {provider.GetTransform().name} (Owner: {provider.GetOwnerId()})</color>");
}
}

View File

@@ -19,9 +19,6 @@ namespace Northbound
[Tooltip("Renderers to show/hide (auto-detected if empty)")]
public Renderer[] renderers;
[Tooltip("Enable debug logging for this object")]
public bool debugLogging = false;
[Header("Height-Based Distant Visibility")]
[Tooltip("Enable visibility from farther away based on object height")]
public bool enableDistantVisibility = true;
@@ -52,11 +49,6 @@ namespace Northbound
if (renderers == null || renderers.Length == 0)
{
renderers = GetComponentsInChildren<Renderer>();
if (debugLogging)
{
Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Auto-detected {renderers.Length} renderers");
}
}
if (renderers == null || renderers.Length == 0)
@@ -81,17 +73,7 @@ namespace Northbound
// Calculate object height for distant visibility
_objectHeight = CalculateObjectHeight();
if (debugLogging)
{
Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Object height = {_objectHeight}m");
}
// CRITICAL: Start hidden and stay hidden until fog system confirms visibility
if (debugLogging)
{
Debug.Log($"[FogOfWarVisibility] {gameObject.name}: START - Setting all {renderers.Length} renderers to HIDDEN");
}
// Force initial hide - don't use SetVisible because _isVisible defaults to false
// which would cause early return
_isVisible = true; // Set to true first so SetVisible(false) actually runs
@@ -198,16 +180,10 @@ namespace Northbound
isDistantVisible = CheckDistantVisibility(fogSystem);
}
if (debugLogging)
{
Debug.Log($"[FogOfWarVisibility] {gameObject.name} at {transform.position}: State={fogState}, DistantVisible={isDistantVisible}, Height={_objectHeight}m");
}
switch (fogState)
{
case FogOfWarState.Visible:
// Currently visible - show with original materials
if (debugLogging) Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Setting VISIBLE");
SetVisible(true);
SetExploredVisual(false);
break;
@@ -217,13 +193,11 @@ namespace Northbound
// BUT: Tall objects can be seen from farther away
if (showInExploredAreas || isDistantVisible)
{
if (debugLogging) Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Setting EXPLORED (visible) - distantVisible={isDistantVisible}");
SetVisible(true);
SetExploredVisual(true);
}
else
{
if (debugLogging) Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Setting EXPLORED (hidden)");
SetVisible(false);
}
break;
@@ -232,13 +206,11 @@ namespace Northbound
// Never seen - hide unless tall enough to see from distance
if (isDistantVisible)
{
if (debugLogging) Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Setting UNEXPLORED but DISTANT VISIBLE");
SetVisible(true);
SetExploredVisual(true); // Show as explored/distant
}
else
{
if (debugLogging) Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Setting UNEXPLORED (hidden)");
SetVisible(false);
}
break;
@@ -276,11 +248,6 @@ namespace Northbound
float baseVisionRange = 15f; // You can make this configurable
float totalRange = baseVisionRange + extendedRange;
if (debugLogging)
{
Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Distance={distanceToPlayer:F1}m, ExtendedRange={totalRange:F1}m (height bonus: +{extendedRange:F1}m)");
}
return distanceToPlayer <= totalRange;
}
@@ -291,29 +258,13 @@ namespace Northbound
_isVisible = visible;
if (renderers == null || renderers.Length == 0)
{
if (debugLogging)
{
Debug.LogWarning($"[FogOfWarVisibility] {gameObject.name}: SetVisible({visible}) called but no renderers!");
}
return;
}
if (debugLogging)
{
Debug.Log($"[FogOfWarVisibility] {gameObject.name}: SetVisible({visible}) - updating {renderers.Length} renderers");
}
foreach (var renderer in renderers)
{
if (renderer != null)
{
renderer.enabled = visible;
if (debugLogging)
{
Debug.Log($"[FogOfWarVisibility] {gameObject.name}: Renderer '{renderer.name}' enabled = {visible}");
}
}
}
}

View File

@@ -121,7 +121,7 @@ namespace Northbound
int totalSpawned = 0;
int targetCount = Mathf.RoundToInt(maxTotalObstacles * density);
Debug.Log($"<color=cyan>[ObstacleSpawner] 장애물 생성 시작 (목표: {targetCount}개)</color>");
// Debug.Log($"<color=cyan>[ObstacleSpawner] 장애물 생성 시작 (목표: {targetCount}개)</color>");
// 각 장애물 타입별로 최소 개수 보장
foreach (var obstacle in obstacles)
@@ -160,7 +160,7 @@ namespace Northbound
// 모든 장애물이 최대치에 도달했는지 확인
if (AllObstaclesAtMax())
{
Debug.Log("<color=yellow>[ObstacleSpawner] 모든 장애물이 최대 개수에 도달했습니다.</color>");
// Debug.Log("<color=yellow>[ObstacleSpawner] 모든 장애물이 최대 개수에 도달했습니다.</color>");
break;
}
continue;
@@ -182,7 +182,7 @@ namespace Northbound
Debug.LogWarning($"<color=yellow>[ObstacleSpawner] 배치 공간이 부족합니다. {totalSpawned}개만 생성되었습니다.</color>");
}
Debug.Log($"<color=green>[ObstacleSpawner] 장애물 생성 완료: {totalSpawned}개</color>");
// Debug.Log($"<color=green>[ObstacleSpawner] 장애물 생성 완료: {totalSpawned}개</color>");
}
private bool AllObstaclesAtMax()
@@ -209,14 +209,14 @@ namespace Northbound
// 최소 거리 체크
if (!IsValidPosition(randomPos))
{
Debug.Log($"<color=orange>[Spawn] 최소 거리 체크 실패: {randomPos}</color>");
// Debug.Log($"<color=orange>[Spawn] 최소 거리 체크 실패: {randomPos}</color>");
continue;
}
// 충돌 체크
if (checkCollision && Physics.CheckSphere(randomPos, collisionCheckRadius, collisionLayers))
{
Debug.Log($"<color=orange>[Spawn] 충돌 감지: {randomPos}, 반경: {collisionCheckRadius}</color>");
// Debug.Log($"<color=orange>[Spawn] 충돌 감지: {randomPos}, 반경: {collisionCheckRadius}</color>");
continue;
}
@@ -226,11 +226,11 @@ namespace Northbound
if (Physics.Raycast(randomPos + Vector3.up * 100f, Vector3.down, out RaycastHit hit, 200f))
{
randomPos = hit.point;
Debug.Log($"<color=cyan>[Spawn] 지형 감지 성공: {hit.collider.name}</color>");
// Debug.Log($"<color=cyan>[Spawn] 지형 감지 성공: {hit.collider.name}</color>");
}
else
{
Debug.Log($"<color=orange>[Spawn] 지형 감지 실패: {randomPos}</color>");
// Debug.Log($"<color=orange>[Spawn] 지형 감지 실패: {randomPos}</color>");
// 지형이 없어도 배치 시도
}
}
@@ -263,7 +263,7 @@ namespace Northbound
}
_spawnedPositions.Add(randomPos);
Debug.Log($"<color=green>[Spawn] 장애물 배치 성공: {obstacleEntry.prefab.name} at {randomPos}</color>");
// Debug.Log($"<color=green>[Spawn] 장애물 배치 성공: {obstacleEntry.prefab.name} at {randomPos}</color>");
return true;
}

View File

@@ -167,7 +167,7 @@ namespace Northbound
PlaySoundClientRpc(true);
}
Debug.Log($"<color=cyan>[TeamGate] {other.name} 텔레포트: {triggeredCollider.name} -> {exitPoint.name}</color>");
// Debug.Log($"<color=cyan>[TeamGate] {other.name} 텔레포트: {triggeredCollider.name} -> {exitPoint.name}</color>");
}
else
{
@@ -177,7 +177,7 @@ namespace Northbound
PlaySoundClientRpc(false);
}
Debug.Log($"<color=yellow>[TeamGate] {other.name} 차단됨 - 팀: {teamMember.GetTeam()}</color>");
// Debug.Log($"<color=yellow>[TeamGate] {other.name} 차단됨 - 팀: {teamMember.GetTeam()}</color>");
}
_triggerStates[other] = false;