public void NextWave() { waveIndex++; if (waveIndex >= arenaWaves.Length) { Debug.Log("Player cleared the final wave."); // If all waves are cleared, but there is a boss battle, activate the boss if (bossBattle) { GameObject.Find("BossHealthBar").GetComponent <BossHealthBar>().ActivateBoss(); waveProgressBar.gameObject.SetActive(false); return; } else { EndBattle(); } } else { currentWave = arenaWaves[waveIndex]; waveProgressBar.value = 0f; Debug.Log("Starting next wave"); currentWave.BeginWave(); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { arenaManager.CurrentArena = this; arenaManager.arenaBattleActive = true; waveProgressBar.gameObject.SetActive(true); Debug.Log("Player entered a battle arena"); arenaManager.DisableProgression(); GetComponent <BattleBarriers>().EnableBarriers(); BattleCol.enabled = false; GameObject.FindGameObjectWithTag("AudioManager").GetComponent <BR_AudioManager>().Play("Fight"); currentWave.BeginWave(); } }