Beispiel #1
0
    void OnceToCreateAround1(Enemy enemyprefab)
    {
        HexCoordinates[] edge;
        edge = new HexCoordinates[36];
        int count = 0;

        for (int i = 0; i < 12; i++)
        {
            for (int j = 0; j < 8; j++)
            {
                if (i == 0 || i == 11)
                {
                    edge[count++] = new HexCoordinates(i, j);
                }
                else if (j == 0 || j == 7)
                {
                    edge[count++] = new HexCoordinates(i, j);
                }
            }
        }

        HexCoordinates spawnCoordinates;

        for (int i = 0; i < 36; i++)
        {
            spawnCoordinates = edge[i];
            Vector3 spawnPosition = HexCoordinates.FromCoordinate(spawnCoordinates);
            Enemy   enemy         = enemyFactory.GetAroundEnemy(spawnPosition, enemyprefab);
            enemies.Add(enemy);
            SearchAndGo(enemy);
        }
    }