コード例 #1
0
        /// <summary>
        ///     Removes all nodes from the PooledLinkedList&lt;T&gt;.
        /// </summary>
        public void Clear()
        {
            var current = First;

            while (current != null)
            {
                var temp = current;
                current = current.Next;
                _pool.Despawn(temp);
            }

            _list.Clear();
        }
コード例 #2
0
        public void Despawn <P>(GameObject go)
            where P : IUIComponents, new()
        {
            IPool pool = Pool <P>();

            pool.Despawn(go);
        }
コード例 #3
0
ファイル: PoolManager.cs プロジェクト: eunho5751/BBB
    public void Despawn(GameObject instance)
    {
        IPool <GameObject> pool = null;

        if (_instanceDict.TryGetValue(instance, out pool))
        {
            pool.Despawn(instance);
        }
        _instanceDict.Remove(instance);
    }
コード例 #4
0
 public virtual void OnCompleted()
 {
     if (parent == null)
     {
         _pool.Despawn(this);
     }
     else
     {
         parent = null;
     }
 }
コード例 #5
0
        /// <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);
            }
        }