From 6edf74b370728a5309409a5f6b1c8e8f8558074e Mon Sep 17 00:00:00 2001 From: kittyegg Date: Thu, 28 May 2026 01:51:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20GameState,=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=83=D1=82=D1=8C=20=D0=BF=D0=BE=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/GameManager.cs | 15 --------------- Assets/Scripts/SandPathBuildService.cs | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 19587b6..3606970 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -11,7 +11,6 @@ public class GameManager : MonoBehaviour } [SerializeField] private Level[] _levels; - [SerializeField] private SandPathBuildService _pathBuildService; [SerializeField] private UnityEvent _onStateChanged; [SerializeField] private UnityEvent _onLevelChanged; @@ -44,20 +43,6 @@ public class GameManager : MonoBehaviour public int CurrentLevel => _currentLvlIndex + 1; public int TotalLevels => _levels.Length; - private void OnEnable() - { - _pathBuildService.OnBuildComplete += OnBuildComplete; - } - private void OnDisable() - { - _pathBuildService.OnBuildComplete -= OnBuildComplete; - } - - private void OnBuildComplete() - { - CurrentState = GameState.BuildingTurrets; - } - public void NextLevel() { _currentLvlIndex = (_currentLvlIndex + 1) % _levels.Length; diff --git a/Assets/Scripts/SandPathBuildService.cs b/Assets/Scripts/SandPathBuildService.cs index 10c2693..c6b1feb 100644 --- a/Assets/Scripts/SandPathBuildService.cs +++ b/Assets/Scripts/SandPathBuildService.cs @@ -56,7 +56,6 @@ public class SandPathBuildService : MonoBehaviour public void ResetPath() { - // TODO: исправить удаление блоков финала пути for (int i = _predefinedBlocks.Length; i < _blocksInPath.Count; i++) { var block = _blocksInPath[i]; @@ -85,6 +84,7 @@ public class SandPathBuildService : MonoBehaviour _currentBlock = _pathEnd; _blocksInPath.Add(_currentBlock); _onBuildComplete?.Invoke(); + _gameManager.CurrentState = GameManager.GameState.BuildingTurrets; } DestroyBlock(block);