/// <summary> /// 释放内存 /// </summary> public static void FreeMemory() { GlobalEvent.DispatchEvent(MemoryEvent.FreeMemory); //清空缓存的UI UIManager.DestroyAllHideUI(); //清空对象池 GameObjectManager.CleanPool(true); //GameObjectManager.CleanPool_New(); AssetsPoolManager.Dispose(); FreeHeapMemory(); Resources.UnloadUnusedAssets(); //GC //GC.Collect(); }