Ejemplo n.º 1
0
    IEnumerator terrainTestNew()
    {
        int testSize = 400;
        int stepSize = 1;
        //int octaves,double persistence
        TerrainGenerator tg = new TerrainGenerator(16384);

        Vector3 testVector = new Vector3(0, 0, 0);
        testSize = testSize / 2;
        double moreThan = 0.44;
        double lessThan = 0.58;

        for (int i = -testSize; i < testSize; i += stepSize)
        {
            yield return 0;
            for (int j = -testSize; j < testSize; j += stepSize)
            {
                int height = 30;
                int kstep = 1;

                if (i > -height && i < height)
                {
                    height = testSize;
                }
                for (int k = -height; k < height; k+=kstep)
                {
                    testVector.x = i;
                    testVector.z = j;

                    testVector.y = k;

                    if (tg.MediumCavern(testVector))
                    {
                        Color col = Color.blue;
                        drawPoint(testVector, col);
                    }
                    else if (tg.SmallCavern(testVector))
                    {
                        Color col = Color.cyan;
                        drawPoint(testVector, col);

                    }
                   /* else if (tg.TestDeposit(testVector))
                    {
                        Color col = Color.grey;
                        drawPoint(testVector, col);

                    }*/
                }
            }
        }
    }