public TrashItem Add(GameObject gameObject, float delay) { var item = new TrashItem(gameObject, delay); list.Add(item); return(item); }
public static void Remove(TrashItem item) { if (item.GameObject) { Destroy(item.GameObject); } Current.list.Remove(item); }
public void Remove(TrashItem item) { if (item == null) { return; } item.Destroy(); list.Remove(item); }
public static TrashItem Add(GameObject gameObject, float delay, bool reParent) { if (reParent) { gameObject.transform.SetParent(Current.transform, true); } var item = new TrashItem(gameObject, delay); Current.list.Add(item); return(item); }