Exemplo n.º 1
0
 public void Release()
 {
     this.m_ReferencedCount--;
     //当引用计数为0时,卸载资源
     if (this.m_ReferencedCount == 0)
     {
         this.m_AssetBundle.Unload(true);
         LOAssetCache.FreeBundle(this.m_AssetBundleName);
     }
 }
Exemplo n.º 2
0
        public void UnloadAssetBundle(string abName, bool remoteAll)
        {
            var lab = cache.GetBundleCache(abName);

            if (lab != null)
            {
                com.QH.QPGame.GameUtils.Logger.Res.Log("unload ab. Name:" + abName);
                if (lab.Release(remoteAll))
                {
                    cache.FreeBundle(abName);
                }

                Resources.UnloadUnusedAssets();
                GC.Collect();
            }
            else
            {
                com.QH.QPGame.GameUtils.Logger.Res.Log("try to unload an unloaded ab!!! Name:" + abName);
            }
        }