mirror of
https://github.com/ryzij/Cube-Tower-Defense.git
synced 2026-07-14 10:06:58 +00:00
24 lines
612 B
C#
24 lines
612 B
C#
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;
|
|
}
|
|
}
|