| | |
| | | /// </summary> |
| | | /// <param name="prefab"></param> |
| | | /// <returns></returns> |
| | | public GameObjectPool RequestPool(GameObject prefab) |
| | | public GameObjectPool GetPool(GameObject prefab) |
| | | { |
| | | if (prefab == null) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | RequestPool(prefab).Cache(count, _prefabActive); |
| | | GetPool(prefab).Cache(count, _prefabActive); |
| | | } |
| | | |
| | | |
| | |
| | | return null; |
| | | } |
| | | #endif |
| | | return RequestPool(prefab).Request(); |
| | | return GetPool(prefab).Request(); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | public HashSet<GameObject> m_ActiveHashSet = new HashSet<GameObject>(); |
| | | public Queue<GameObject> m_FreeQueue = null; |
| | | private int Pool_FreeList_Warning_Threshold = 10; //当空闲对象高于此值时,会进行日志输出提醒 |
| | | private int Pool_FreeList_Warning_Threshold = 50; //当空闲对象高于此值时,会进行日志输出提醒 |
| | | |
| | | Action<GameObject> releaseCallBack; |
| | | |