using System.Collections.Generic; namespace ET { public class HashSetComponent: Object { private bool isDispose; public static HashSetComponent Create() { HashSetComponent hashSetComponent = ObjectPool.Instance.Fetch>(); hashSetComponent.isDispose = false; return hashSetComponent; } public HashSet Set = new HashSet(); public override void Dispose() { if (this.isDispose) { return; } this.isDispose = true; base.Dispose(); this.Set.Clear(); ObjectPool.Instance.Recycle(this); } } }