public void instantiateEnvironmentObject(EnviromentObject asset)
 {
 }
예제 #2
0
    void PlaceLocationPoints()
    {
        for (int i = 0; i < topTreeCount; i++)
        {
            int x = Random.Range(0, width);
            int y = Random.Range(0, height);
            while (usedVerticies[x, y] == true)
            {
                x = Random.Range(0, width);
                y = Random.Range(0, height);
            }

            int prefab = Random.Range(0, floraPrefabs.Count);
            if (genType == GenType.RandomPlacement)
            {
                EnviromentObject enviro = new EnviromentObject();
                enviro.position = tVertices[x, y];
                enviro.floraObject = testprefab;
                // enviro.floraObject = floraPrefabs[prefab];
                floraGeneration.Add(enviro);
                usedVerticies[x, y] = true;
                //if(x >= usedVerticies.Length && y >= usedVerticies.Length)
                //    usedVerticies[x+1, y+1] = true;
                //if (x <= 0 && y <= 0)
                //    usedVerticies[x - 1, y - 1] = true;
                //if (x >= usedVerticies.Length && y <= 0)
                //    usedVerticies[x + 1, y - 1] = true;
                //if (x <= 0 && y >= usedVerticies.Length)
                //    usedVerticies[x - 1, y + 1] = true;
                //if (x >= usedVerticies.Length)
                //    usedVerticies[x + 1, y] = true;
                //if (x <= 0)
                //    usedVerticies[x - 1, y] = true;
                //if (y <= 0)
                //    usedVerticies[x, y - 1] = true;
                //if (x >= usedVerticies.Length)
                //    usedVerticies[x, y + 1] = true;
            }

        }
    }