public void ClearCachesAndFreeMemory(int severity) { UnityEngine.Debug.LogWarning(string.Format("Clearing Caches; this will force assets to be reloaded off disk and may be slow! {0}", severity)); if (StoreManager.Get() != null) { StoreManager.Get().UnloadAndFreeMemory(); } if (severity > 15) { if (SpellCache.Get() != null) { SpellCache.Get().Clear(); } AssetCache.ClearAllCaches(true, false); } ApplicationMgr.Get().UnloadUnusedAssets(); }
public void UnloadAllCaches(bool clearPersistent = false, bool clearLoading = true) { AssetCache.ClearAllCaches(clearPersistent, clearLoading); this.FreeMemory(); }