/// <summary> /// Replaces a chunk with another one /// </summary> /// <param name="id">Chunk id to replace</param> /// <param name="chunk">Replacement chunk</param> internal void ReplaceChunk(uint id, StorageChunk chunk) { Cache = null; var index = ChunkDictionary[id]; FailIndex(index); ChunkList[index] = chunk; ChunkDictionary.Remove(id); ChunkDictionary[chunk.Id] = index; }
public void RemoveBlock(GameObject currentChunk, Block block) { ChunkDictionary.Remove(block.Position); //Ich entferne erst den Block auf dem Chunk IChunk chunk = currentChunk.GetComponent <IChunk>(); chunk.RemoveBlock(block); // Und erstelle anschließend mit den restlichen Blöcken den Chunk ModifyMesh.RemoveBlockFromMesh(currentChunk.transform, block); DeleteChunkIfNotNeeded(chunk); }