public static void Recycle <TComponent>(List <TComponent> list) where TComponent : class, IComponentBase { for (int i = 0; i < list.Count; ++i) { PoolRegistries.Recycle(list[i], list[i].GetType()); } list.Clear(); }
public static void Recycle <TComponent>(HashSet <TComponent> list) where TComponent : class, IComponentBase { foreach (var item in list) { PoolRegistries.Recycle(item); } list.Clear(); }
public static void Recycle <TComponent>(ref TComponent[] list) where TComponent : class, IComponentBase { for (int i = 0; i < list.Length; ++i) { PoolRegistries.Recycle(list[i]); } PoolArray <TComponent> .Recycle(ref list); }
public static void Recycle <T>(ref T system) where T : class, IComponentBase { PoolRegistries.Recycle(system); system = null; }