UnityPooler.PoolableGameObject.ReleaseObjectsAndClearPool C# (CSharp) Method

ReleaseObjectsAndClearPool() public method

public ReleaseObjectsAndClearPool ( ) : void
return void
        public void ReleaseObjectsAndClearPool()
        {
            Initialize();
            ReleaseObjects();
            Clear();
        }

Usage Example

示例#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();
        }