/// <summary> /// Removes all nodes from the PooledLinkedList<T>. /// </summary> public void Clear() { var current = First; while (current != null) { var temp = current; current = current.Next; _pool.Despawn(temp); } _list.Clear(); }
public void Despawn <P>(GameObject go) where P : IUIComponents, new() { IPool pool = Pool <P>(); pool.Despawn(go); }
public void Despawn(GameObject instance) { IPool <GameObject> pool = null; if (_instanceDict.TryGetValue(instance, out pool)) { pool.Despawn(instance); } _instanceDict.Remove(instance); }
public virtual void OnCompleted() { if (parent == null) { _pool.Despawn(this); } else { parent = null; } }
/// <summary> /// --if the poolname is never used, then assert; /// --if the poolname is already removed, then directly destroy object /// if cannot find the pool, then directly destroy object /// if the pool is in use, the action == PoolMgr["somepool"].Despawn(obj) /// </summary> public void Despawn(string poolname, object obj) { IPool pool = null; bool bFound = m_poolCont.TryGetValue(poolname, out pool); if (!bFound) { if (obj is UnityEngine.Object) { UnityEngine.Object.Destroy((UnityEngine.Object)obj); } } else { pool.Despawn(obj); } }