Esempio n. 1
0
 /// <summary>
 /// 对象池管理器轮询
 /// </summary>
 /// <param name="elapseSeconds">逻辑流逝时间,以秒为单位</param>
 /// <param name="realElapseSeconds">真实流逝时间,以秒为单位</param>
 internal void OnUpdate(float deltaTime, float unscaledDeltaTime)
 {
     foreach (KeyValuePair <string, ObjectPoolBase> objectPool in m_ObjectPools)
     {
         objectPool.Value.OnUpdate(deltaTime, unscaledDeltaTime);
     }
     ClassObjectPool.OnUpdate(deltaTime, unscaledDeltaTime);
 }
Esempio n. 2
0
        /// <summary>
        /// 关闭并清理对象池管理器
        /// </summary>
        public override void Dispose()
        {
            ClassObjectPool.Dispose();

            foreach (KeyValuePair <string, ObjectPoolBase> objectPool in m_ObjectPools)
            {
                objectPool.Value.Shutdown();
            }

            m_ObjectPools.Clear();
        }
Esempio n. 3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public PoolManager()
        {
            ClassObjectPool = new ClassObjectPool();

            m_ObjectPools = new Dictionary <string, ObjectPoolBase>();
        }