Пример #1
0
        public static void ClearStackItem(string name, bool clearMemory)
        {
            if (0 > Holder.m_stackIP)
            {
                Holder._CreateDefaultStack();
            }
            name = name.ToLower();
            bool flag = false;
            Dictionary <string, WWWItem> dictionary = null;

            for (int i = Holder.m_stackIP; i >= 0; i--)
            {
                string b = Holder.m_bundleNameStack[i].ToLower();
                if (name == b)
                {
                    dictionary = Holder.m_bundleGroupStack[i];
                    foreach (KeyValuePair <string, WWWItem> current in dictionary)
                    {
                        Holder._UnloadAssetBundle(current.Value, clearMemory);
                    }
                    dictionary.Clear();
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                TsLog.Log("[TsBundle] ClearStackItem() Cannot found StackName= {0}", new object[]
                {
                    name
                });
            }
        }
Пример #2
0
 private static void PopBundleGroup()
 {
     if (0 > Holder.m_stackIP)
     {
         Holder._CreateDefaultStack();
     }
     else
     {
         Dictionary <string, WWWItem> dictionary = Holder.m_bundleGroupStack[Holder.m_stackIP];
         foreach (KeyValuePair <string, WWWItem> current in dictionary)
         {
             Holder._UnloadAssetBundle(current.Value, true);
         }
         dictionary.Clear();
         Holder.m_bundleGroupStack.RemoveAt(Holder.m_stackIP);
         Holder.m_bundleNameStack.RemoveAt(Holder.m_stackIP);
         Holder.m_stackIP--;
     }
 }
Пример #3
0
 public static void RemoveWWWItem(WWWItem wItem, bool clearMemory)
 {
     if (wItem.inUndefinedStack)
     {
         string key = wItem.assetPath.ToLower();
         if (Holder.ms_UndefinedStack.ContainsKey(key))
         {
             wItem.refCnt--;
             if (clearMemory || 0 >= wItem.refCnt)
             {
                 Holder._UnloadAssetBundle(wItem, clearMemory);
                 Holder.ms_UndefinedStack.Remove(key);
             }
         }
     }
     else
     {
         Holder.RemoveWWWItem(wItem.assetPath, clearMemory);
     }
 }
Пример #4
0
        public static void RemoveWWWItem(string key, bool clearMemory)
        {
            key = key.ToLower();
            WWWItem wWWItem = null;

            for (int i = Holder.m_stackIP; i >= 0; i--)
            {
                Dictionary <string, WWWItem> dictionary = Holder.m_bundleGroupStack[i];
                dictionary.TryGetValue(key, out wWWItem);
                if (wWWItem != null)
                {
                    wWWItem.refCnt--;
                    if (clearMemory || 0 >= wWWItem.refCnt)
                    {
                        Holder._UnloadAssetBundle(wWWItem, clearMemory);
                        dictionary.Remove(key);
                    }
                }
            }
        }