public void UnloadAllChunks() { List <Vec2i> chunkKeys = new List <Vec2i>(); foreach (KeyValuePair <Vec2i, LoadedChunk2> kpv in LoadedChunks) { chunkKeys.Add(kpv.Key); Destroy(kpv.Value.gameObject); } LoadedChunks.Clear(); EntityManager.Instance?.UnloadChunks(chunkKeys); }