예제 #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);
        }
예제 #2
0
파일: SpawnTool.cs 프로젝트: qipa/LGFrame
 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);
     }
 }