Example #1
0
    IEnumerator GenerateAllEnemy()
    {
        ++level;
        UpdateLevel();
        UpdateScore();
        if (level != 1)
        {
            enemySpeedMult += 0.1f;
        }
        if (enemySpeedMult > maxNaturalEnemySpeedMult)
        {
            enemySpeedMult = maxNaturalEnemySpeedMult;
        }
        isGeneratingNewEnemies = true;
        yield return(new WaitForSeconds(1.5f));

        EnemyGroupMovement e = enemyGroup.GetComponent <EnemyGroupMovement>();

        e.ResetState();
        numberOfEnemies      += 25;
        numberOfBlueEnemies  += 10;
        numberOfRedEnemies   += 10;
        numberOfGreenEnemies += 5;
        for (int i = 0; i < 5; ++i)
        {
            for (int j = 0; j < 2; ++j)
            {
                GenerateBlueEnemy(i, j);
                GenerateRedEnemy(i, j);
                if (j == 0)
                {
                    GenerateGreenEnemy(i, j);
                }
            }
        }
        yield return(new WaitForSeconds(0.05f));

        SortBlueEnemyRenderer();
        SortRedEnemyRenderer();
        SortGreenEnemyRenderer();

        realGreenEnemyObjs = GameObject.FindGameObjectsWithTag("GreenEnemy");

        isGeneratingNewEnemies = false;
        // enemyGroup.transform.position = Vector3.zero;
    }
Example #2
0
 private void Awake()
 {
     movement = GetComponent <EnemyGroupMovement>();
     attack   = GetComponent <EnemyGroupAttack>();
 }