Assets/Examples/Scripts/World.cs
/// <summary>
/// Tries to get a chunk at a world position
/// </summary>
/// <param name="worldPosition">World position of the chunk (can be inside the chunk, doesn't have to be the chunk's origin)</param>
/// <param name="chunk">The chunk at that position (if any)</param>
/// <returns>Does a chunk exist at that world position</returns>
Tries to get a chunk at a world position
Tries to get a chunk at a world position
public bool TryGetChunk(int3 worldPosition, out Chunk chunk)
        {
            int3 chunkCoordinate = WorldPositionToCoordinate(worldPosition);
            return Chunks.TryGetValue(chunkCoordinate, out chunk);
        }
public bool TryGetChunk ( int3 worldPosition , out Chunk chunk ) { int3 chunkCoordinate = WorldPositionToCoordinate ( worldPosition ) ; return Chunks . TryGetValue ( chunkCoordinate , out chunk ) ; }
Tries to get a chunk at a world position
Tries to get a chunk at a world position
Does a chunk exist at that world position
Does a chunk exist at that world position
worldPosition
int3
World position of the chunk (can be inside the chunk, doesn't have to be the chunk's origin)
World position of the chunk ( can be inside the chunk doesn ' t have to be the chunk ' s origin )
Chunk
out
chunk
The chunk at that position (if any)
The chunk at that position ( if any )