Assets/Examples/Scripts/HeightmapWorld.cs
/// <summary>
/// Creates the heightmap terrain and instantiates the chunks.
/// </summary>
Creates the heightmap terrain and instantiates the chunks.
Creates the heightmap terrain and instantiates the chunks .
private void CreateHeightmapTerrain()
        {
            int chunkCountX = Mathf.CeilToInt((float) (heightmapTerrainSettings.Width - 1) / ChunkSize);
            int chunkCountZ = Mathf.CeilToInt((float) (heightmapTerrainSettings.Height - 1) / ChunkSize);
            int chunkCountY = Mathf.CeilToInt(heightmapTerrainSettings.Amplitude / ChunkSize);
            for (int x = 0; x < chunkCountX; x++)
            {
                for (int y = 0; y < chunkCountY; y++)
                {
                    for (int z = 0; z < chunkCountZ; z++)
                    {
                        CreateChunk(new int3(x, y, z));
                    }
                }
            }
        }
private void CreateHeightmapTerrain ( ) { int chunkCountX = Mathf . CeilToInt ( ( float ) ( heightmapTerrainSettings . Width - 1 ) / ChunkSize ) ; int chunkCountZ = Mathf . CeilToInt ( ( float ) ( heightmapTerrainSettings . Height - 1 ) / ChunkSize ) ; int chunkCountY = Mathf . CeilToInt ( heightmapTerrainSettings . Amplitude / ChunkSize ) ; for ( int x = 0 ; x < chunkCountX ; x ++ ) { for ( int y = 0 ; y < chunkCountY ; y ++ ) { for ( int z = 0 ; z < chunkCountZ ; z ++ ) { CreateChunk ( new int3 ( x , y , z ) ) ; } } } }
Creates the heightmap terrain and instantiates the chunks.
Creates the heightmap terrain and instantiates the chunks .