public void OnTarget(Interface_Item from) { if (this.item != null) { if (helditem.item != null) { Debug.Log("On target1"); Item duplicate = new Item(helditem.item); from.UpdateInterface(this.item); UpdateInterface(duplicate); helditem.UpdateInterface(null); } /*else * { * helditem.UpdateInterface(this.item); * UpdateInterface(null); * }*/ } else { Debug.Log("On target"); if (helditem.item != null) { from.UpdateInterface(this.item); UpdateInterface(helditem.item); helditem.UpdateInterface(null); } } }
void Awake() { canvas = GameObject.Find("Canvas"); image = GetComponentInChildren <Image>(); equipment = GameObject.Find("Equipped_Panel").GetComponent <Interface_Equipped>(); UpdateInterface(null); helditem = GameObject.Find("MovedItem").GetComponent <Interface_Item>(); }