Esempio n. 1
0
    /// <summary>
    /// 一般是切换场景的时候调用 如:OnLeaveScene
    /// </summary>
    public void UnloadAll()
    {
        var e = map.GetEnumerator();

        while (e.MoveNext())
        {
            XResources.UnloadAsset(e.Current.Value);
        }
        e.Dispose();
        map.Clear();
    }
Esempio n. 2
0
 public bool Unload(uint hash)
 {
     if (map != null && map.ContainsKey(hash))
     {
         map[hash].ref_cnt--;
         if (map[hash].ref_cnt <= 0)
         {
             XResources.UnloadAsset(map[hash]);
             map[hash].obt = null;
             map.Remove(hash);
             return(true);
         }
     }
     return(false);
 }
Esempio n. 3
0
 /// <summary>
 /// 一般是切换场景的时候调用 如:OnLeaveScene
 /// </summary>
 public void UnloadAll()
 {
     if (bundle_cnt > 0)
     {
         for (int i = 0; i < bundle_cnt; i++)
         {
             bundles[i].Unload(true, true);
         }
         bundle_cnt = 0;
         bundles.Clear();
     }
     if (map != null)
     {
         var e = map.GetEnumerator();
         while (e.MoveNext())
         {
             XResources.UnloadAsset(e.Current.Value);
         }
         e.Dispose();
         map.Clear();
     }
 }