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