// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { manager.SpawnWave(1); } }
public void BeginRound() { pc = Instantiate(pcPrefab, Vector3.zero, Quaternion.identity); pc.currentLives = startingLives; livesText.text = startingLives.ToString(); wm = Instantiate(waveManagerPrefab); nextLifeAt = newLifeEvery; wm.SpawnWave(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); WaveManager script = (WaveManager)target; if (GUILayout.Button("Spawn Wave")) { script.SpawnWave(); } }
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()); }