Assets/Examples/Scripts/HeightmapWorld.cs
/// <summary>
/// Instantiates a chunk to the specified coordinate
/// </summary>
/// <param name="chunkCoordinate">The chunk's coordinate</param>
/// <returns>The instantiated chunk</returns>
Instantiates a chunk to the specified coordinate
Instantiates a chunk to the specified coordinate
private HeightmapChunk CreateChunk(int3 chunkCoordinate)
        {
            HeightmapChunk chunk = Instantiate(ChunkPrefab, (chunkCoordinate * ChunkSize).ToVectorInt(), Quaternion.identity).GetComponent<HeightmapChunk>();
            chunk.name = $"Chunk_{chunkCoordinate.x}_{chunkCoordinate.y}_{chunkCoordinate.z}";
            chunk.World = this;
            chunk.Initialize(ChunkSize, Isolevel, chunkCoordinate);
            Chunks.Add(chunkCoordinate, chunk);
            return chunk;
        }
private HeightmapChunk CreateChunk ( int3 chunkCoordinate ) { HeightmapChunk chunk = Instantiate ( ChunkPrefab , ( chunkCoordinate * ChunkSize ) . ToVectorInt ( ) , Quaternion . identity ) . GetComponent < HeightmapChunk > ( ) ; chunk . name = $" Chunk_ { chunkCoordinate . x } _ { chunkCoordinate . y } _ { chunkCoordinate . z } " ; chunk . World = this ; chunk . Initialize ( ChunkSize , Isolevel , chunkCoordinate ) ; Chunks . Add ( chunkCoordinate , chunk ) ; return chunk ; }
Instantiates a chunk to the specified coordinate
Instantiates a chunk to the specified coordinate
The instantiated chunk
The instantiated chunk
chunkCoordinate
int3
The chunk's coordinate
The chunk ' s coordinate