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); } } }
/*public void OnPointerClick(PointerEventData eventData) * { * * }*/ public void OnPointerDown(PointerEventData eventData) { Debug.Log("drag_start"); if (this.item != null) { if (helditem.item != null) { Item duplicate = new Item(helditem.item); helditem.UpdateInterface(this.item); UpdateInterface(duplicate); } else { helditem.UpdateInterface(this.item); UpdateInterface(null); } } helditem.GetComponent <Description>().ChangeDescription(); /*else * if (helditem.item != null) * { * UpdateInterface(helditem.item); * helditem.UpdateInterface(null); * }*/ }
public void UpdateSlot(string name, Item item) { if (item != null) { switch (name) { case "Sails": if (item.item_class == "Sails") { sails.UpdateInterface(item); } break; case "Stern": if (item.item_class == "Stern") { stern.UpdateInterface(item); } break; case "Fuselage": if (item.item_class == "Fuselage") { fuselage.UpdateInterface(item); } break; case "Cannons": if (item.item_class == "Cannons") { cannons.UpdateInterface(item); } break; } } game.UpdateStats(WearedModifiers()); }