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