yyl
2026-05-11 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96
Main/Core/ResModule/GameObjectPoolManager.cs
@@ -3,6 +3,8 @@
using System;
using Cysharp.Threading.Tasks;
using System.Linq;
using YooAsset;
#if UNITY_EDITOR
using UnityEngine.Profiling;
@@ -185,7 +187,7 @@
        }
        // 启动定期检查池的协程
        CheckPoolUsage();
        CheckPoolUsage().Forget();
    }
    private async UniTask CheckPoolUsage()
@@ -248,7 +250,7 @@
    /// </summary>
    /// <param name="prefab"></param>
    /// <returns></returns>
    public GameObjectPool RequestPool(GameObject prefab)
    public GameObjectPool GetPool(GameObject prefab)
    {
        if (prefab == null)
        {
@@ -286,7 +288,7 @@
            return;
        }
        RequestPool(prefab).Cache(count, _prefabActive);
        GetPool(prefab).Cache(count, _prefabActive);
    }
@@ -304,7 +306,7 @@
            return null;
        }
#endif
        return RequestPool(prefab).Request();
        return GetPool(prefab).Request();
    }
@@ -346,7 +348,7 @@
        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;