public override void OnLateUpdate(float deltaTime) { long currentTime = MDebug.GetMillisecondsSinceStartup(); for (int iPool = m_StrongObjectPools.Count - 1; iPool >= 0; iPool--) { IObjectPool iterPool = m_StrongObjectPools[iPool]; if (iterPool.GetUsingCount() == 0 && currentTime - iterPool.GetLastUsingTime() > AUTO_GC_MILLISECONDS) { MDebug.Log("Pool" , $"ObjectPool<{iterPool.GetObjectType().FullName}> will be GC."); m_StrongObjectPools.RemoveAt(iPool); m_WeakObjectPools.Remove(TypeToKey(iterPool.GetObjectType())); } } }