From 2a3e3417d4498a6c6d0cecc96bd849c5162cef76 Mon Sep 17 00:00:00 2001 From: kittyegg Date: Fri, 29 May 2026 18:12:04 +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=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Debugger.cs | 22 ---------------------- Assets/Scripts/UI/TurretsShopViewer.cs | 8 ++++---- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/Assets/Scripts/Debugger.cs b/Assets/Scripts/Debugger.cs index 0f8042b..40f894e 100644 --- a/Assets/Scripts/Debugger.cs +++ b/Assets/Scripts/Debugger.cs @@ -5,18 +5,12 @@ public class Debugger : MonoBehaviour [SerializeField] private GameManager _gameManager; [SerializeField] private SandPathBuildService _sandPathBuildService; [SerializeField] private SpawnDeathEnemyController _spawnDeathControl; - [SerializeField] private Tower _tower; - [SerializeField] private BlockDetector _blockDetector; - - private int _blockCount; private void OnEnable() { _gameManager.OnStateChanged += OnGameStateChanged; _sandPathBuildService.OnBuildComplete += OnBuildComplete; _spawnDeathControl.OnLastEnemyDestroyed += OnLastEnemyDestroyed; - _tower.OnGameOver += OnGameOver; - _blockDetector.OnBlockClicked += OnBlockClicked; } private void OnDisable() @@ -24,16 +18,11 @@ public class Debugger : MonoBehaviour _gameManager.OnStateChanged -= OnGameStateChanged; _sandPathBuildService.OnBuildComplete -= OnBuildComplete; _spawnDeathControl.OnLastEnemyDestroyed -= OnLastEnemyDestroyed; - _tower.OnGameOver -= OnGameOver; - _blockDetector.OnBlockClicked -= OnBlockClicked; } 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() @@ -45,15 +34,4 @@ public class Debugger : MonoBehaviour { print("Last enemy destroyed"); } - - 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 diff --git a/Assets/Scripts/UI/TurretsShopViewer.cs b/Assets/Scripts/UI/TurretsShopViewer.cs index 15c7dae..55ed885 100644 --- a/Assets/Scripts/UI/TurretsShopViewer.cs +++ b/Assets/Scripts/UI/TurretsShopViewer.cs @@ -55,16 +55,16 @@ public class TurretsShopViewer : MonoBehaviour private void OnBlockSelected(BlockScript block) { + if (!_hidden) + return; + // Чтобы анимация не воспроизводилась когда не надо - if (_ignoreBlocks.Contains(block)) + if (_ignoreBlocks.Count > 0 && _ignoreBlocks.Contains(block)) { _ignoreBlocks.Clear(); return; } - if (!_hidden) - return; - _animator.CrossFade(_showAnimation, 0.1f); _hidden = false; }