Exemple #1
0
    public EnemyMinion[] SpawnWave()
    {
        EnemyMinionFactory minionFactory = new EnemyMinionFactory();

        EnemyMinion[] listOfWave = new EnemyMinion[wave.Length];
        for (int i = 0; i < wave.Length; i++)
        {
            listOfWave[i] = minionFactory.MakeEnemyMinion(wave[i]);
        }
        return(listOfWave);
    }
Exemple #2
0
    public EnemyMinion[] SpawnWave()
    {
        EnemyMinionFactory minionFactory = new EnemyMinionFactory();
        int length = Random.Range(1, 4);

        EnemyMinion[] listOfWave = new EnemyMinion[length];
        for (int i = 0; i < length; i++)
        {
            int randNum = Random.Range(1, 10);
            if (randNum >= 1 && randNum < 6)
            {
                listOfWave[i] = minionFactory.MakeEnemyMinion(wave[0]);
            }
            else if (randNum >= 6 && randNum < 10)
            {
                listOfWave[i] = minionFactory.MakeEnemyMinion(wave[1]);
            }
            else
            {
                listOfWave[i] = minionFactory.MakeEnemyMinion(wave[2]);
            }
        }
        return(listOfWave);
    }