From 2057a9f9fd8721ecf361d55a93dd2dc1dc3f326a Mon Sep 17 00:00:00 2001 From: kittyegg Date: Thu, 28 May 2026 10:53:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Debugger.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Debugger.cs b/Assets/Scripts/Debugger.cs index 7eb029c..0f8042b 100644 --- a/Assets/Scripts/Debugger.cs +++ b/Assets/Scripts/Debugger.cs @@ -6,6 +6,9 @@ public class Debugger : MonoBehaviour [SerializeField] private SandPathBuildService _sandPathBuildService; [SerializeField] private SpawnDeathEnemyController _spawnDeathControl; [SerializeField] private Tower _tower; + [SerializeField] private BlockDetector _blockDetector; + + private int _blockCount; private void OnEnable() { @@ -13,6 +16,7 @@ public class Debugger : MonoBehaviour _sandPathBuildService.OnBuildComplete += OnBuildComplete; _spawnDeathControl.OnLastEnemyDestroyed += OnLastEnemyDestroyed; _tower.OnGameOver += OnGameOver; + _blockDetector.OnBlockClicked += OnBlockClicked; } private void OnDisable() @@ -21,11 +25,15 @@ public class Debugger : MonoBehaviour _sandPathBuildService.OnBuildComplete -= OnBuildComplete; _spawnDeathControl.OnLastEnemyDestroyed -= OnLastEnemyDestroyed; _tower.OnGameOver -= OnGameOver; + _blockDetector.OnBlockClicked -= OnBlockClicked; } - private static void OnGameStateChanged(GameManager.GameState newState) + private void OnGameStateChanged(GameManager.GameState newState) { print("State changed, current state: " + newState); + + if (newState == GameManager.GameState.BuildingTurrets) + print("Total blocks in path: " + _blockCount); } private static void OnBuildComplete() @@ -33,13 +41,19 @@ public class Debugger : MonoBehaviour print("Build complete"); } - private void OnLastEnemyDestroyed() + private static void OnLastEnemyDestroyed() { print("Last enemy destroyed"); } - private void OnGameOver() + private static void OnGameOver() { print("Game over"); } + + private void OnBlockClicked(BlockScript block) + { + if (_gameManager.CurrentState == GameManager.GameState.BuildingPath) + print("Block: " + ++_blockCount + " - " + block); + } } \ No newline at end of file