Пример #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();
     GameObjectPool.Dispose();
 }
Пример #3
0
 /// <summary>
 /// ÊÍ·ÅÀà¶ÔÏó³Ø
 /// </summary>
 public void ClearClassObjectPool()
 {
     ClassObjectPool.Clear();
 }
Пример #4
0
 public PoolManager()
 {
     ClassObjectPool = new ClassObjectPool();
     GameObjectPool  = new GameObjectPool();
 }
Пример #5
0
 /// <summary>
 /// 释放类对象池
 /// </summary>
 public void ReleaseClassObjectPool()
 {
     ClassObjectPool.Release();
 }