Beispiel #1
0
        /// <summary>
        /// 强制回收所有资源
        /// </summary>
        public static void ForceReleaseAll()
        {
            for (int i = 0; i < _fileLoaders.Count; i++)
            {
                AssetFileLoader loader = _fileLoaders[i];
                loader.Destroy(true);
            }
            _fileLoaders.Clear();

            // 释放所有资源
            Resources.UnloadUnusedAssets();
        }
Beispiel #2
0
 /// <summary>
 /// 资源回收
 /// 卸载引用计数为零的资源
 /// </summary>
 public static void Release()
 {
     for (int i = _fileLoaders.Count - 1; i >= 0; i--)
     {
         AssetFileLoader loader = _fileLoaders[i];
         if (loader.IsDone() && loader.RefCount <= 0)
         {
             loader.Destroy(true);
             _fileLoaders.RemoveAt(i);
         }
     }
 }