디버깅용 로그 제거
This commit is contained in:
@@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user