SpawnWave() public method

Starts a wave from the upcomming Waves list. Ends the game when all the waves have been ran, all the enemies are dead, and the player didn't lose.
public SpawnWave ( ) : void
return void
Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         manager.SpawnWave(1);
     }
 }
Exemplo n.º 2
0
 public void BeginRound()
 {
     pc = Instantiate(pcPrefab, Vector3.zero, Quaternion.identity);
     pc.currentLives = startingLives;
     livesText.text  = startingLives.ToString();
     wm         = Instantiate(waveManagerPrefab);
     nextLifeAt = newLifeEvery;
     wm.SpawnWave();
 }
Exemplo n.º 3
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            WaveManager script = (WaveManager)target;

            if (GUILayout.Button("Spawn Wave"))
            {
                script.SpawnWave();
            }
        }
Exemplo n.º 4
0
    private IEnumerator WaveCycle()
    {
        //some magic to controll the waves sorry :(
        yield return(new WaitForSeconds(LocalConfig.TimeBeforeFirstWave));

        _secondsToNextWave = LocalConfig.SecondsBetweenWaves;
        while (true)
        {
            if (_astronautDead)
            {
                break;
            }
            _waveCount++;
            _waveManager.SpawnWave(ChangeWave());
            while (_secondsToNextWave > 0)
            {
                yield return(new WaitForSeconds(1f));

                _secondsToNextWave--;
            }
            _secondsToNextWave = LocalConfig.SecondsBetweenWaves;
        }
    }
 public static void SpawnNewWave()
 {
     instance.StartCoroutine(instance.SpawnWave());
 }