This commit is contained in:
CortexCore
2025-08-05 23:34:10 +08:00
parent c3f0a8e840
commit 2554487fa4
23 changed files with 652 additions and 67 deletions

View File

@@ -26,13 +26,11 @@ namespace BITKit.Pool
public void Dispose()
{
var hashset = new HashSet<GameObject>();
foreach (var (_,list) in Pool)
{
foreach (var obj in list)
{
if (obj is not Component component) continue;
if (!hashset.Add(component.gameObject)) continue;
if (component)
Object.Destroy(component.gameObject);
}