Exemplo 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);
 }
Exemplo 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();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public PoolManager()
        {
            ClassObjectPool = new ClassObjectPool();

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