Example #1
0
    void Update()
    {
        if (currentNumberOfEnemies > 0 || enemiesToSpawn > 0)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.Return))
        {
            text.SetActive(false);
            AmountToSpawn();
            SpawnEnemies();
            if (wave < 10)
            {
                music.ChangeMusic(2);
            }
            else
            {
                music.ChangeMusic(3);
            }
        }

        if (currentNumberOfEnemies <= 0 && enemiesToSpawn <= 0)
        {
            music.ChangeMusic(1);
        }
    }