Ejemplo n.º 1
0
        static IObjectPool <T> GetObjectPool <T>() where T : Component
        {
            IObjectPoolManager tmpPoolMgr = GameModuleManager.GetModule <IObjectPoolManager>();
            IObjectPool <T>    tmpObjPool = null;

            if (null != tmpPoolMgr)
            {
                tmpObjPool = tmpPoolMgr.GetObjectPool <T>();
            }

            return(tmpObjPool);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取对象池。
 /// </summary>
 /// <typeparam name="T">对象类型。</typeparam>
 /// <returns>要获取的对象池。</returns>
 public IObjectPool <T> GetObjectPool <T>() where T : ObjectBase
 {
     return(m_ObjectPoolManager.GetObjectPool <T>());
 }
 /// <summary>
 /// 获取对象池
 /// </summary>
 /// <typeparam name="T">对象类型</typeparam>
 /// <param name="name">对象池名称</param>
 /// <returns>要获取的对象池</returns>
 public IObjectPool <T> GetObjectPool <T>(string name = null) where T : ObjectBase
 {
     return(m_ObjectPoolManager.GetObjectPool <T>(name));
 }