Добавил переключение режима после уничтожения последного врага

This commit is contained in:
2026-05-15 01:15:56 +03:00
parent cf45eab2bc
commit 99d4d91cbe
4 changed files with 40 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
using UnityEngine;
using System.Collections;
public class EndWaveStateSwitch : MonoBehaviour
{
[SerializeField] private GameManager _gameManager;
[SerializeField] private SpawnDeathEnemyController _spawnDeathEnemyController;
private void OnEnable()
{
_spawnDeathEnemyController.OnLastEnemyDestroyed += OnLastEnemyDestroyed;
}
private void OnDisable()
{
_spawnDeathEnemyController.OnLastEnemyDestroyed -= OnLastEnemyDestroyed;
}
private void OnLastEnemyDestroyed()
{
_gameManager.CurrentState = GameManager.GameState.BuildingTurrets;
}
}