private TerrainBlock.Type SetBlockTypeAt(TerrainChunk chunk, Index3D blockLocalIndex, TerrainBlock.Type blockNewType) { var blockType = chunk.GetBlock(blockLocalIndex).BlockType; chunk.SetBlockType(blockLocalIndex, blockNewType); chunkGenerator.BuildMeshFor(chunk); return(blockType); }
private TerrainBlock GetBlockAt(Vector3 pointInWorld, out TerrainChunk chunk) { var chunkIndex = config.GetChunkIndexAt(pointInWorld); chunk = chunkGenerator.GetOrGenerateEmpty(chunkIndex, chunksParent); var blockLocalIndex = chunk.GetBlockLocalIndexAt(pointInWorld); return(chunk.GetBlock(blockLocalIndex)); }