Exemplo n.º 1
0
    void Spawn()
    {
        Spread newSpread;

        if (bm.GetLevel() < 4)
        {
            Debug.Log("Got easy spread");
            newSpread = enemySpreads.GetRandomSpread();
        }
        else
        {
            newSpread = enemySpreads.GetRandomHardSpread();
        }
        List <Vector2Int> newEnemyPos = newSpread.GetEnemyPositions();
        List <GameObject> newEnemies  = newSpread.GetEnemyRefs();

        numEnemies = newEnemies.Count;
        Debug.Log(numEnemies);
        enemyList = new List <GameObject>();

        for (int i = 0; i < newEnemies.Count; i++)
        {
            enemyList.Add(bm.GetTile(newEnemyPos[i].x, newEnemyPos[i].y).SpawnUnit(newEnemies[i], bm));
            bm.takeGridAvailibility(newEnemyPos[i].x, newEnemyPos[i].y);
        }
    }
Exemplo n.º 2
0
    void Spawn()
    {
        Spread            newSpread   = enemySpreads.GetRandomSpread();
        List <Vector2Int> newEnemyPos = newSpread.GetEnemyPositions();
        List <GameObject> newEnemies  = newSpread.GetEnemyRefs();

        numEnemies = newEnemies.Count;
        Debug.Log(numEnemies);

        for (int i = 0; i < newEnemies.Count; i++)
        {
            bm.GetTile(newEnemyPos[i].x, newEnemyPos[i].y).SpawnUnit(newEnemies[i], bm);
        }
    }