Merged start and next button to play

This commit is contained in:
BOT Alex 2024-04-21 06:15:42 +02:00
parent 258b467857
commit ca31124728
1 changed files with 4 additions and 11 deletions

View File

@ -18,7 +18,7 @@ public class EnemySpawnManager : MonoBehaviour
[Header("Buttons")]
[SerializeField] private Button StartButton;
[SerializeField] private Button PlayButton;
[SerializeField] private Button NextButton;
[SerializeField] private Button AutoPlayButton;
@ -28,22 +28,15 @@ public class EnemySpawnManager : MonoBehaviour
{
waveQueue = new Queue<Wave>(levelDefinition.Waves);
if (StartButton != null)
StartButton.onClick.AddListener(OnStartButtonClicked);
if (NextButton != null)
NextButton.onClick.AddListener(OnNextButtonClicked);
if (PlayButton != null)
PlayButton.onClick.AddListener(OnPlayButtonClicked);
if (AutoPlayButton != null)
AutoPlayButton.onClick.AddListener(ToggleAutoPlayClicked);
}
public void OnStartButtonClicked()
public void OnPlayButtonClicked()
{
HasStarted = true;
PopWave();
}
public void OnNextButtonClicked()
{
time = waveQueue.Peek().spawnTime;
PopWave();
}