mirror of
https://github.com/ryzij/Cube-Tower-Defense.git
synced 2026-07-14 01:56:57 +00:00
Добавил переключение режима после уничтожения последного врага
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user