public void StartWave() { if (waveNumber <= waves.Count) { waveStartedIndicator.GetComponentInParent <HoverContextElement> ().text = "Speed up the game"; HoverContextElement.activeElement = null; upcomingHeader.text = "Remaining"; wavePrebbing = false; waveStarted = true; waveStartedIndicator.color = Color.red; waveCounterIndicator.text = "Wave: " + ExternalWaveNumber.ToString(); gameProgress = GetProgressForWave(ExternalWaveNumber); ContinueWave(true); PlayerInput.cur.UpdateFlushBattlefieldHoverContextElement(); } }
public void EndWave(bool finished) { PlayerInput.cur.flushBattlefieldAnimator.SetBool("Flashing", false); ForceInstantCleanEnemyArray(); Game.CrossfadeMusic(Game.game.constructionMusic, 2f); SetPortals(false); Game.ChangeButtons(true); waveStarted = false; currentSubwave = null; subwaveNumber = 0; if (Game.fastGame) { Game.ToggleFastGameSpeed(); } waveStartedIndicator.color = Color.green; UpdateAmountModifier(); if (finished && Datastream.healthAmount > 0) { Game.credits += 25 * ExternalWaveNumber; PlayerInput.ChangeFlushTimer(-1); Game.game.SaveGame("autosave"); Datastream.healthAmount = Mathf.Min(Datastream.healthAmount + Datastream.healPerWave, Datastream.STARTING_HEALTH); Datastream.cur.UpdateNumberMaterials(); } if (waves.Count >= waveNumber + 1) { UpdateUpcomingWaveScreen(waves [waveNumber], ExternalWaveNumber, upcomingWindow); } waveCounterIndicator.text = "Wave: " + ExternalWaveNumber.ToString(); if (Game.state == Game.State.Started) { waveStartedIndicator.GetComponentInParent <HoverContextElement>().text = "Start wave " + (waveNumber + 1).ToString(); } HoverContextElement.activeElement = null; PlayerInput.ChangeFlushTimer(0); }