コード例 #1
0
        protected void OnChunkLoaded(LandscapeManagerChunkEventArgs e)
        {
            e.Chunk.BlocksChanged            += ChunkBlocksChanged;
            e.Chunk.Entities.CollectionDirty += EntitiesCollectionDirty;

            var handler = ChunkLoaded;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 void LandscapeManagerChunkUnloaded(object sender, LandscapeManagerChunkEventArgs e)
 {
     e.Chunk.BlocksChanged          -= ChunkBlocksChanged;
     e.Chunk.Entities.EntityAdded   -= EntitiesEntityAdded;
     e.Chunk.Entities.EntityRemoved -= EntitiesEntityRemoved;
 }