Добавил новые состояния для игры

This commit is contained in:
2026-06-06 03:05:43 +03:00
parent 74c88748d0
commit 657fe72379
3 changed files with 21 additions and 3 deletions
+6 -2
View File
@@ -40,8 +40,11 @@ public class WinLoseController : MonoBehaviour
private void OnLastEnemyDestroyed()
{
if (_isLastLevel)
_onWin?.Invoke();
if (!_isLastLevel)
return;
_gameManager.CurrentState = GameManager.GameState.Win;
_onWin?.Invoke();
}
private void OnLevelChanged(GameManager.OnLevelChangedEventArgs args)
@@ -52,6 +55,7 @@ public class WinLoseController : MonoBehaviour
private void OnDeath()
{
_gameManager.CurrentState = GameManager.GameState.Lose;
_onGameOver?.Invoke(new OnGameOverEventArgs(_currentLevel));
}