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

@@ -3,6 +3,7 @@ using Interactions;
using UnityEngine;
using System;
using AppleHills.Core.Settings;
using Core;
using UnityEngine.Serialization;
namespace PuzzleS
@@ -102,7 +103,7 @@ namespace PuzzleS
}
// Default fallback behavior
Debug.Log($"[Puzzles] Prompt shown for {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Prompt shown for {stepData?.stepId} on {gameObject.name}");
}
/// <summary>
@@ -118,7 +119,7 @@ namespace PuzzleS
}
// Default fallback behavior
Debug.Log($"[Puzzles] Prompt hidden for {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Prompt hidden for {stepData?.stepId} on {gameObject.name}");
}
/// <summary>
@@ -137,7 +138,7 @@ namespace PuzzleS
}
// Default fallback behavior
Debug.Log($"[Puzzles] Player entered far range of {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Player entered far range of {stepData?.stepId} on {gameObject.name}");
}
/// <summary>
@@ -156,7 +157,7 @@ namespace PuzzleS
}
// Default fallback behavior
Debug.Log($"[Puzzles] Player entered close range of {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Player entered close range of {stepData?.stepId} on {gameObject.name}");
}
/// <summary>
@@ -175,7 +176,7 @@ namespace PuzzleS
}
// Default fallback behavior
Debug.Log($"[Puzzles] Player exited close range of {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Player exited close range of {stepData?.stepId} on {gameObject.name}");
}
/// <summary>
@@ -194,7 +195,7 @@ namespace PuzzleS
}
// Default fallback behavior
Debug.Log($"[Puzzles] Player exited far range of {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Player exited far range of {stepData?.stepId} on {gameObject.name}");
}
/// <summary>
@@ -203,7 +204,7 @@ namespace PuzzleS
public void UnlockStep()
{
_isUnlocked = true;
Debug.Log($"[Puzzles] Step unlocked: {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Step unlocked: {stepData?.stepId} on {gameObject.name}");
// Show indicator if enabled in settings
if (puzzleIndicator != null)
@@ -219,7 +220,7 @@ namespace PuzzleS
if (_indicator == null)
{
Debug.LogWarning($"[Puzzles] Indicator prefab for {stepData?.stepId} does not implement IPuzzlePrompt");
Logging.Warning($"[Puzzles] Indicator prefab for {stepData?.stepId} does not implement IPuzzlePrompt");
}
else
{
@@ -262,7 +263,7 @@ namespace PuzzleS
public void LockStep()
{
_isUnlocked = false;
Debug.Log($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
// Hide indicator
if (_indicator != null)
@@ -296,7 +297,7 @@ namespace PuzzleS
if (!_isUnlocked) return;
if (success)
{
Debug.Log($"[Puzzles] Step interacted: {stepData?.stepId} on {gameObject.name}");
Logging.Debug($"[Puzzles] Step interacted: {stepData?.stepId} on {gameObject.name}");
PuzzleManager.Instance?.MarkPuzzleStepCompleted(stepData);
}
}

View File

@@ -4,7 +4,8 @@ using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.SceneManagement;
using AppleHills.Core.Settings; // Added for IInteractionSettings
using AppleHills.Core.Settings;
using Core; // Added for IInteractionSettings
namespace PuzzleS
{
@@ -86,7 +87,7 @@ namespace PuzzleS
{
SceneManager.sceneLoaded -= OnSceneLoaded;
Debug.Log("[MDPI] OnSceneLoaded");
Logging.Debug("[MDPI] OnSceneLoaded");
_runtimeDependencies.Clear();
BuildRuntimeDependencies();
UnlockInitialSteps();
@@ -173,7 +174,7 @@ namespace PuzzleS
_unlockedSteps.Clear();
BuildRuntimeDependencies();
UnlockInitialSteps();
Debug.Log($"[Puzzles] Registered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}");
Logging.Debug($"[Puzzles] Registered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}");
}
}
@@ -185,7 +186,7 @@ namespace PuzzleS
{
if (behaviour?.stepData == null) return;
_stepBehaviours.Remove(behaviour.stepData);
Debug.Log($"[Puzzles] Unregistered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}");
Logging.Debug($"[Puzzles] Unregistered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}");
}
/// <summary>
@@ -198,10 +199,10 @@ namespace PuzzleS
{
foreach (var dep in _runtimeDependencies[step])
{
Debug.Log($"[Puzzles] Step {step.stepId} depends on {dep.stepId}");
Logging.Debug($"[Puzzles] Step {step.stepId} depends on {dep.stepId}");
}
}
Debug.Log($"[Puzzles] Runtime dependencies built. Total steps: {_stepBehaviours.Count}");
Logging.Debug($"[Puzzles] Runtime dependencies built. Total steps: {_stepBehaviours.Count}");
}
/// <summary>
@@ -213,7 +214,7 @@ namespace PuzzleS
var initialSteps = PuzzleGraphUtility.FindInitialSteps(_runtimeDependencies);
foreach (var step in initialSteps)
{
Debug.Log($"[Puzzles] Initial step unlocked: {step.stepId}");
Logging.Debug($"[Puzzles] Initial step unlocked: {step.stepId}");
UnlockStep(step);
}
@@ -229,7 +230,7 @@ namespace PuzzleS
// Check if all dependencies have been completed
if (AreRuntimeDependenciesMet(step))
{
Debug.Log($"[Puzzles] Chain step unlocked: {step.stepId}");
Logging.Debug($"[Puzzles] Chain step unlocked: {step.stepId}");
UnlockStep(step);
madeProgress = true;
}
@@ -245,7 +246,7 @@ namespace PuzzleS
{
if (_completedSteps.Contains(step)) return;
_completedSteps.Add(step);
Debug.Log($"[Puzzles] Step completed: {step.stepId}");
Logging.Debug($"[Puzzles] Step completed: {step.stepId}");
// Broadcast completion
OnStepCompleted?.Invoke(step);
@@ -254,12 +255,12 @@ namespace PuzzleS
{
if (AreRuntimeDependenciesMet(unlock))
{
Debug.Log($"[Puzzles] Unlocking step {unlock.stepId} after completing {step.stepId}");
Logging.Debug($"[Puzzles] Unlocking step {unlock.stepId} after completing {step.stepId}");
UnlockStep(unlock);
}
else
{
Debug.Log($"[Puzzles] Step {unlock.stepId} not unlocked yet, waiting for other dependencies");
Logging.Debug($"[Puzzles] Step {unlock.stepId} not unlocked yet, waiting for other dependencies");
}
}
CheckPuzzleCompletion();
@@ -292,7 +293,7 @@ namespace PuzzleS
{
behaviour.UnlockStep();
}
Debug.Log($"[Puzzles] Step unlocked: {step.stepId}");
Logging.Debug($"[Puzzles] Step unlocked: {step.stepId}");
// Broadcast unlock
OnStepUnlocked?.Invoke(step);
@@ -305,7 +306,7 @@ namespace PuzzleS
{
if (_completedSteps.Count == _stepBehaviours.Count)
{
Debug.Log("[Puzzles] Puzzle complete! All steps finished.");
Logging.Debug("[Puzzles] Puzzle complete! All steps finished.");
// TODO: Fire puzzle complete event or trigger outcome logic
}
}