示例#1
0
        /// <summary>
        /// Phá hủy hồ bơi của target
        /// </summary>
        public void DestroyPool <T>(T target) where T : MonoBehaviour
        {
            Pooling pooling = target.GetComponent <Pooling>();

            DestroyPool(pooling);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pool"></param>
        /// <param name="pooling"></param>
        /// <param name="t"></param>
        /// <returns></returns>
        private IEnumerator IEDestroy(Pool pool, Pooling pooling, float t)
        {
            yield return(new WaitForSeconds(t));

            pool.Destroy(pooling);
        }
示例#3
0
        /// <summary>
        /// Tạo một hồ bơi của prefab với kích thước ban đầu
        /// SetActivate không tự động được gọi
        /// </summary>
        public void CreatePool <T>(T target, int capacity, Transform parent = null) where T : MonoBehaviour
        {
            Pooling pooling = target.GetComponent <Pooling>();

            CreatePool(pooling, capacity, parent);
        }