コード例 #1
0
        private void OnDestroy()
        {
            SaveChunkData();

            PathFinding.Dispose();
            WorldSettings.Dispose();

            // dispose native containers
            pendingJobs.Dispose();
            meshBakingJobs.Dispose();
        }
コード例 #2
0
        public void DisposeAndSave()
        {
            SaveChunkData();

            // dispose all active & pooled chunks
            foreach (var chunk in Chunks.Values)
            {
                chunk.Dispose();
            }
            foreach (var chunk in pooledChunks)
            {
                chunk.Dispose();
            }

            PathFinding.Dispose();
            WorldSettings.Dispose();

            // dispose native containers
            chunkBuildingJobs.Dispose();
            meshBakingJobs.Dispose();
        }