diff --git a/Assets/TEngine/Runtime/Core/MemPoolMgr.cs b/Assets/TEngine/Runtime/Core/MemPoolMgr.cs index 7d6fcd3a..11b37b16 100644 --- a/Assets/TEngine/Runtime/Core/MemPoolMgr.cs +++ b/Assets/TEngine/Runtime/Core/MemPoolMgr.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Diagnostics; -using Debug = UnityEngine.Debug; namespace TEngine { @@ -10,22 +9,16 @@ namespace TEngine void Destroy(); } - public interface MemPoolBase + public interface IMemPoolBase { string GetName(); int GetPoolItemCount(); void ClearPool(); } - public class MemPool - { - - } - - public class MemPoolMgr : TSingleton { - List m_listPool = new List(); + List m_listPool = new List(); [Conditional("UNITY_EDITOR")] public void ShowCount() @@ -35,12 +28,12 @@ namespace TEngine { var pool = m_listPool[i]; totalCnt += pool.GetPoolItemCount(); - TLogger.LogInfo("[pool][{0}] [{1}]", pool.GetName(), pool.GetPoolItemCount()); + TLogger.LogInfoSuccessd("[pool][{0}] [{1}]", pool.GetName(), pool.GetPoolItemCount()); } - TLogger.LogInfo("-------------------------memory pool count: {0}", totalCnt); + TLogger.LogInfoSuccessd("-------------------------memory pool count: {0}", totalCnt); } - public void RegMemPool(MemPoolBase pool) + public void RegMemPool(IMemPoolBase pool) { m_listPool.Add(pool); } @@ -55,7 +48,7 @@ namespace TEngine } } - public class GameMemPool : TSingleton>, MemPoolBase where T : IMemPoolObject, new() + public class GameMemPool : TSingleton>, IMemPoolBase where T : IMemPoolObject, new() { private List m_objPool = new List(); diff --git a/Assets/TEngine/Runtime/Core/ListPool.cs b/Assets/TEngine/Runtime/Core/ObjectPoolMgr.cs similarity index 93% rename from Assets/TEngine/Runtime/Core/ListPool.cs rename to Assets/TEngine/Runtime/Core/ObjectPoolMgr.cs index 6601128a..982639bd 100644 --- a/Assets/TEngine/Runtime/Core/ListPool.cs +++ b/Assets/TEngine/Runtime/Core/ObjectPoolMgr.cs @@ -3,7 +3,11 @@ using UnityEngine.Events; namespace TEngine { - public static class ListPool + /// + /// 对象池管理器 + /// + /// + public static class ObjectPoolMgr { private static readonly ObjectPool> m_ListPool = new ObjectPool>(null, Clear); diff --git a/Assets/TEngine/Runtime/Core/ListPool.cs.meta b/Assets/TEngine/Runtime/Core/ObjectPoolMgr.cs.meta similarity index 83% rename from Assets/TEngine/Runtime/Core/ListPool.cs.meta rename to Assets/TEngine/Runtime/Core/ObjectPoolMgr.cs.meta index f857c378..e708ebe7 100644 --- a/Assets/TEngine/Runtime/Core/ListPool.cs.meta +++ b/Assets/TEngine/Runtime/Core/ObjectPoolMgr.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ce3d838c8607a1442acaee8b2ff1b7af +guid: 521d4cc35b3e9d84d9ad2e5de2c4cc09 MonoImporter: externalObjects: {} serializedVersion: 2