Strip debug logging from the game, fix screen weirdness

This commit is contained in:
Michal Pikulski
2025-10-14 15:53:58 +02:00
parent 18be597424
commit e8180b21bf
65 changed files with 768 additions and 411 deletions

View File

@@ -7,6 +7,7 @@ using Pooling;
using AppleHills.Core.Settings;
using Utils;
using AppleHills.Core.Interfaces;
using Core;
namespace Minigames.DivingForPictures
{
@@ -158,7 +159,7 @@ namespace Minigames.DivingForPictures
// Check if the prefab has a Tile component
if (tilePrefabs[i].GetComponent<Tile>() == null)
{
Debug.LogWarning($"Prefab {tilePrefabs[i].name} does not have a Tile component. Adding one automatically.");
Logging.Warning($"Prefab {tilePrefabs[i].name} does not have a Tile component. Adding one automatically.");
// Add the Tile component if it doesn't exist
tilePrefabs[i].AddComponent<Tile>();
}
@@ -220,7 +221,7 @@ namespace Minigames.DivingForPictures
_speedRampingCoroutine = null;
}
Debug.Log("[TrenchTileSpawner] Paused");
Logging.Debug("[TrenchTileSpawner] Paused");
}
/// <summary>
@@ -238,7 +239,7 @@ namespace Minigames.DivingForPictures
StartTileSpawningCoroutine();
StartSpeedRampingCoroutine();
Debug.Log("[TrenchTileSpawner] Resumed");
Logging.Debug("[TrenchTileSpawner] Resumed");
}
/// <summary>
@@ -264,7 +265,7 @@ namespace Minigames.DivingForPictures
StartTileSpawningCoroutine();
StartSpeedRampingCoroutine();
Debug.Log("[TrenchTileSpawner] Initialized with normalized speed");
Logging.Debug("[TrenchTileSpawner] Initialized with normalized speed");
}
/// <summary>
@@ -327,7 +328,7 @@ namespace Minigames.DivingForPictures
{
// Fallback in case no renderer is found
_tileHeights[prefab] = DefaultTileHeight;
Debug.LogWarning($"No renderer found in prefab {prefab.name}. Using default height of {DefaultTileHeight}.");
Logging.Warning($"No renderer found in prefab {prefab.name}. Using default height of {DefaultTileHeight}.");
}
}
}
@@ -449,7 +450,7 @@ namespace Minigames.DivingForPictures
// Calculate normalization factor based on screen height
_screenNormalizationFactor = Screen.height / referenceHeight;
Debug.Log($"[TrenchTileSpawner] Screen normalization factor: {_screenNormalizationFactor} (Screen height: {Screen.height}, Reference: {referenceHeight})");
Logging.Debug($"[TrenchTileSpawner] Screen normalization factor: {_screenNormalizationFactor} (Screen height: {Screen.height}, Reference: {referenceHeight})");
}
/// <summary>
@@ -466,7 +467,7 @@ namespace Minigames.DivingForPictures
// Recalculate velocity immediately
CalculateVelocity();
Debug.Log($"[TrenchTileSpawner] Velocity factor updated to {_velocityFactor:F2}, moveSpeed: {_baseMoveSpeed:F2}");
Logging.Debug($"[TrenchTileSpawner] Velocity factor updated to {_velocityFactor:F2}, moveSpeed: {_baseMoveSpeed:F2}");
}
/// <summary>
@@ -482,7 +483,7 @@ namespace Minigames.DivingForPictures
// Reverse the active tiles array to maintain consistent indexing logic
_activeTiles.Reverse();
Debug.Log("[TrenchTileSpawner] Started surfacing - reversed array order");
Logging.Debug("[TrenchTileSpawner] Started surfacing - reversed array order");
}
/// <summary>
@@ -509,7 +510,7 @@ namespace Minigames.DivingForPictures
/// </summary>
private IEnumerator MoveActiveTilesRoutine()
{
Debug.Log($"[TrenchTileSpawner] Started movement coroutine with normalized speed: {_baseMoveSpeed:F3}");
Logging.Debug($"[TrenchTileSpawner] Started movement coroutine with normalized speed: {_baseMoveSpeed:F3}");
while (enabled && gameObject.activeInHierarchy && !_isPaused)
{
@@ -550,7 +551,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileDestructionRoutine()
{
const float checkInterval = 0.5f; // Check every half second
Debug.Log($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s");
Logging.Debug($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy && !_isPaused)
{
@@ -618,7 +619,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileSpawningRoutine()
{
const float checkInterval = 0.2f; // Check every fifth of a second
Debug.Log($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s");
Logging.Debug($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy && !_isPaused && !_stopSpawning)
{
@@ -711,7 +712,7 @@ namespace Minigames.DivingForPictures
private IEnumerator SpeedRampingRoutine()
{
const float checkInterval = 1.0f; // Check once per second
Debug.Log($"[TrenchTileSpawner] Started speed ramping coroutine with interval: {checkInterval}s");
Logging.Debug($"[TrenchTileSpawner] Started speed ramping coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy && !_isPaused)
{
@@ -887,7 +888,7 @@ namespace Minigames.DivingForPictures
_activeTiles.Add(tile);
_tileLastUsed[prefabIndex] = _spawnCounter++;
_currentDepth++;
Debug.Log($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
onTileSpawned?.Invoke(tile);
// --- FLOATING AREA STATE MANAGEMENT ---
@@ -949,7 +950,7 @@ namespace Minigames.DivingForPictures
}
_activeTiles.Add(tile);
_currentDepth++;
Debug.Log($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
onTileSpawned?.Invoke(tile);
// Optionally update floating area state if needed
Tile spawnedTile = tile.GetComponent<Tile>();
@@ -1035,7 +1036,7 @@ namespace Minigames.DivingForPictures
{
if (tile == null)
{
Debug.LogWarning("Attempted to get height of null tile!");
Logging.Warning("Attempted to get height of null tile!");
return DefaultTileHeight;
}
@@ -1171,7 +1172,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileDestructionCoroutine()
{
const float checkInterval = 0.5f; // Check every half second as requested
Debug.Log($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s");
Logging.Debug($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy)
{
@@ -1248,7 +1249,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileSpawningCoroutine()
{
const float checkInterval = 0.2f; // Check every half second as requested
Debug.Log($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s");
Logging.Debug($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy)
{