protected void OnChunkLoaded(LandscapeManagerChunkEventArgs e) { e.Chunk.BlocksChanged += ChunkBlocksChanged; e.Chunk.Entities.CollectionDirty += EntitiesCollectionDirty; var handler = ChunkLoaded; if (handler != null) { handler(this, e); } }
protected void OnChunkUnloaded(LandscapeManagerChunkEventArgs e) { e.Chunk.BlocksChanged -= ChunkBlocksChanged; e.Chunk.Entities.CollectionDirty -= EntitiesCollectionDirty; //Flush the generator buffered chunk if needed. _generator.FlushBuffers(e.Chunk.Position); var handler = ChunkUnloaded; if (handler != null) { handler(this, e); } }
void LandscapeManagerChunkUnloaded(object sender, LandscapeManagerChunkEventArgs e) { e.Chunk.BlocksChanged -= ChunkBlocksChanged; e.Chunk.Entities.EntityAdded -= EntitiesEntityAdded; e.Chunk.Entities.EntityRemoved -= EntitiesEntityRemoved; }