public void RemoveClip(AudioClip _clip) { string key = _clip.name; if (!dic.ContainsKey(key)) { return; } AudioFactoryUnit unit = dic[key]; unit.Dispose(); dic.Remove(key); }
public void Dispose(bool _force) { List <string> delKeyList = new List <string> (); foreach (KeyValuePair <String, AudioFactoryUnit> pair in dic) { AudioFactoryUnit unit = pair.Value; if (_force || unit.willDispose) { unit.Dispose(); delKeyList.Add(pair.Key); } } for (int i = 0; i < delKeyList.Count; i++) { dic.Remove(delKeyList[i]); } }