///// <summary> ///// 是否允许动态加载 ///// </summary> //public static bool s_allowDynamicLoad = false; ///// <summary> ///// 最大允许的内存使用量 ///// </summary> //public static int s_MaxMemoryUse = 150; /// <summary> /// 释放一部分内存 /// </summary> public static void FreeMemory() { //清空对象池 GameObjectManager.CleanPool(); //清空缓存的UI UIManager.DestroyAllHideUI(); //GC GC.Collect(); }
static int CleanPool(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); GameObjectManager.CleanPool(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// 释放内存 /// </summary> public static void FreeMemory() { GlobalEvent.DispatchEvent(MemoryEvent.FreeMemory); //清空对象池 GameObjectManager.CleanPool(); //清空缓存的UI UIManager.DestroyAllHideUI(); FreeHeapMemory(); //GC //GC.Collect(); }
/// <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(); }
/// <summary> /// 释放内存 /// </summary> public static void FreeMemory() { GlobalEvent.DispatchEvent(MemoryEvent.FreeMemory); //清空缓存的UI UIManager.DestroyAllHideUI(); //清空对象池 GameObjectManager.CleanPool(); LanguageManager.Release(); // AssetsUnloadHandler.UnloadAll(); FreeHeapMemory(); Resources.UnloadUnusedAssets(); //GC GC.Collect(); }
/// <summary> /// 释放内存 /// </summary> public static void FreeMemory() { GlobalEvent.DispatchEvent(MemoryEvent.FreeMemory); //清空缓存的UI UIManager.DestroyAllHideUI(); if (IsLowMachine()) { //清空对象池 GameObjectManager.CleanPool(); } LanguageManager.Release(); //GameObjectManager.CleanPool_New(); // AssetsPoolManager.DisposeAll(); FreeHeapMemory(); Resources.UnloadUnusedAssets(); //GC GC.Collect(); }