Esempio n. 1
0
    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();
        }
    }
Esempio n. 2
0
    public void Reset()
    {
        DisableBarriers();
        BattleCol.gameObject.SetActive(true);
        BattleCol.enabled = true;

        if (arenaWaves != null)
        {
            foreach (ArenaWave a in arenaWaves)
            {
                a.enemiesDefeated = 0;
            }
            currentWave = arenaWaves[0];
        }
    }
Esempio n. 3
0
    void Start()
    {
        arenaManager = GameObject.FindObjectOfType <ArenaManager>();

        if (!arenaManager)
        {
            Debug.Log("No arena manager was found");
        }

        activateBoss = false;

        if (waveProgressBar == null)
        {
            Debug.Log("The progress bar for arena battle " + gameObject.name + " was not assigned in the inspector.");
        }

        else
        {
            waveProgressBar.value = 0f;
        }

        if (waveProgressText == null)
        {
            Debug.Log("The progress text for arena battle " + gameObject.name + " was not assigned in the inspector.");
        }

        else
        {
            waveProgressText.text = (waveProgressBar.value * 100f).ToString("F0") + "%";
        }

        if (arenaWaves == null)
        {
            Debug.Log("No waves have been set up for the current arena battle.");
        }

        else
        {
            waveIndex   = 0;
            currentWave = arenaWaves[waveIndex];
        }
    }