Merged start and next button to play
This commit is contained in:
parent
258b467857
commit
29fb5aba30
|
@ -18,8 +18,7 @@ public class EnemySpawnManager : MonoBehaviour
|
||||||
|
|
||||||
[Header("Buttons")]
|
[Header("Buttons")]
|
||||||
|
|
||||||
[SerializeField] private Button StartButton;
|
[SerializeField] private Button PlayButton;
|
||||||
[SerializeField] private Button NextButton;
|
|
||||||
[SerializeField] private Button AutoPlayButton;
|
[SerializeField] private Button AutoPlayButton;
|
||||||
|
|
||||||
private Queue<Wave> waveQueue;
|
private Queue<Wave> waveQueue;
|
||||||
|
@ -28,22 +27,15 @@ public class EnemySpawnManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
waveQueue = new Queue<Wave>(levelDefinition.Waves);
|
waveQueue = new Queue<Wave>(levelDefinition.Waves);
|
||||||
|
|
||||||
if (StartButton != null)
|
if (PlayButton != null)
|
||||||
StartButton.onClick.AddListener(OnStartButtonClicked);
|
PlayButton.onClick.AddListener(OnPlayButtonClicked);
|
||||||
if (NextButton != null)
|
|
||||||
NextButton.onClick.AddListener(OnNextButtonClicked);
|
|
||||||
if (AutoPlayButton != null)
|
if (AutoPlayButton != null)
|
||||||
AutoPlayButton.onClick.AddListener(ToggleAutoPlayClicked);
|
AutoPlayButton.onClick.AddListener(ToggleAutoPlayClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnStartButtonClicked()
|
public void OnPlayButtonClicked()
|
||||||
{
|
{
|
||||||
HasStarted = true;
|
HasStarted = true;
|
||||||
PopWave();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnNextButtonClicked()
|
|
||||||
{
|
|
||||||
time = waveQueue.Peek().spawnTime;
|
time = waveQueue.Peek().spawnTime;
|
||||||
PopWave();
|
PopWave();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue