예제 #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 PoolManager()
 {
     ClassObjectPool = new ClassObjectPool();
     GameObjectPool  = new GameObjectPool();
 }
예제 #3
0
 public void Dispose()
 {
     ClassObjectPool.Dispose();
     GameObjectPool.Dispose();
 }