Небольшие исправления

This commit is contained in:
2026-05-29 18:12:04 +03:00
parent 9405cb7328
commit 2a3e3417d4
2 changed files with 4 additions and 26 deletions
-22
View File
@@ -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);
}
}