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 }); } }
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--; } }
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); } }
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); } } } }