private void _DestoryChunk(bool createProxy, bool fromDisable) { if (cachedSector.TopTerrain || cachedSector.BottomTerrain || cachedSector.RightTerrain || cachedSector.LeftTerrain) { cachedSector.DisonnectTerrainNeighbors(); } #if UNITY_5_LATE #pragma warning disable CS0618 // Typ lub sk³adowa jest przestarza³a Application.UnloadLevel(ScenePath); #pragma warning restore CS0618 // Typ lub sk³adowa jest przestarza³a #else GameObject.Destroy(chunkRoot); #endif chunkRoot = null; chunkSector = null; recenterChunk = false; if (asyncLoadOp != null) { if (chunkActivating == this) { chunkActivating = null; } activationQueue.Remove(this); asyncLoadOp = null; } if (fromDisable || quitting) { _UnloadResources(); } else if (!requestedDeferredUnload) { requestedDeferredUnload = true; StartCoroutine("_DeferredUnload"); } loadState = LoadState.Unloaded; if (createProxy && ProxyMesh) { _CreateProxy(); } }