コード例 #1
0
        public PoolManager()
        {
            ClassObjectPool = new ClassObjectPool();
            GameObjectPool  = new GameObjectPool();
            AssetBundlePool = new ResourcePool("AssetBundlePool");
            AssetPool       = new Dictionary <AssetCategory, ResourcePool>();

            var enumerator = Enum.GetValues(typeof(AssetCategory)).GetEnumerator();

            while (enumerator.MoveNext())
            {
                AssetCategory assetCategory = (AssetCategory)enumerator.Current;
                if (assetCategory == AssetCategory.None)
                {
                    continue;
                }
                AssetPool[assetCategory] = new ResourcePool(assetCategory.ToString());
            }
        }
コード例 #2
0
 public void Dispose()
 {
     ClassObjectPool.Dispose();
 }
コード例 #3
0
 /// <summary>
 /// 释放类对象池
 /// </summary>
 public void ClearClassObjectPool()
 {
     ClassObjectPool.ClearPool();
 }
コード例 #4
0
 public PoolManager()
 {
     ClassObjectPool = new ClassObjectPool();
     GameObjectPool  = new GameObjectPool();
 }