ReleaseObjectsAndClearPool() public method

public ReleaseObjectsAndClearPool ( ) : void
return void
Exemplo n.º 1
0
        /// <summary>
        /// Releases all live objects and clears the pool.
        /// </summary>
        /// <param name="objToClear"></param>
        public static void ReleaseAndClearPoolWithObj(GameObject objToClear)
        {
            PoolableGameObject poolable = objToClear.GetComponent <PoolableGameObject>();

            if (poolable == null)
            {
                Debug.LogErrorFormat(REQUIRES_COMP, objToClear.name, "ReleaseAndClearPool");
                return;
            }

            poolable.ReleaseObjectsAndClearPool();
        }