Exemple #1
0
        public static int getHeight(int tilePositionX, int tilePositionZ)
        {
            var perlinRand = Perlin.CalcPixel2D(tilePositionX, tilePositionZ, 0.02f) / 255;
            var expRand    = Mathf.Abs(Noise.ExpRand(perlinRand, 0.375f));
            var height     = Mathf.FloorToInt(expRand * Tile.TileSize.y);

            return(height < 1 ? 1 : height);
        }