Ejemplo n.º 1
0
        public static UnityComponentPool <T> GetPool <T>(string poolName) where T : Component
        {
            UnityComponentPool <T> pool = null;

            if (Pool.ContainsKey(poolName))
            {
                pool = Pool[poolName] as UnityComponentPool <T>;
            }

            return(pool);
        }
Ejemplo n.º 2
0
 private void Start()
 {
     Debug.Log("Pool Awake");
     for (int i = 0; i < Pool.Count; i++)
     {
         var temp = this.Pool[i];
         var pool = new UnityComponentPool <Transform>(temp.poolName, temp.prefab, temp.parent, temp.maxCount);
         //Debug.LogFormat("poolName = {0}, maxCount = {1}, preLoadCount = {2}", temp.poolName, temp.maxCount, temp.preLoadCount);
         //pool.PreloadAsync(temp.preLoadCount);
         pool.PreLoad(temp.preLoadCount);
     }
 }