public virtual void Awake() { th = GetComponent <TagHandler>(); item = GetComponentInChildren <Item>(); if (item) { th.Add(item.GetComponent <TagHandler>().tagList); } c = GetComponent <Collider>(); if (!item && c) { c.isTrigger = true; } }
public Item Swap(Item i) { Item drop = item; item = (i) ? i.Collect(transform, true) : null; if (drop) { th.Clear(); } if (item) { th.Add(item.GetComponent <TagHandler>().tagList); } c.isTrigger = (!item); return((drop) ? drop.Drop(true) : null); }