From 29fb5aba301b22ab74ac11ef07d8c7283809f028 Mon Sep 17 00:00:00 2001 From: BOT Alex <44818698+MagicBOTAlex@users.noreply.github.com> Date: Sun, 21 Apr 2024 06:15:42 +0200 Subject: [PATCH] Merged start and next button to play --- Assets/Scripts/Manager/EnemySpawnManager.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Assets/Scripts/Manager/EnemySpawnManager.cs b/Assets/Scripts/Manager/EnemySpawnManager.cs index 905f339..9354542 100644 --- a/Assets/Scripts/Manager/EnemySpawnManager.cs +++ b/Assets/Scripts/Manager/EnemySpawnManager.cs @@ -18,8 +18,7 @@ public class EnemySpawnManager : MonoBehaviour [Header("Buttons")] - [SerializeField] private Button StartButton; - [SerializeField] private Button NextButton; + [SerializeField] private Button PlayButton; [SerializeField] private Button AutoPlayButton; private Queue waveQueue; @@ -28,22 +27,15 @@ public class EnemySpawnManager : MonoBehaviour { waveQueue = new Queue(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(); }