public TrashItem Add(GameObject gameObject, float delay)
        {
            var item = new TrashItem(gameObject, delay);

            list.Add(item);

            return(item);
        }
示例#2
0
        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);
        }
示例#4
0
        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);
        }