public void OnPointerDown(PointerEventData eventData) { // Debug.Log(eventData.pointerCurrentRaycast.gameObject.name); if (eventData.pointerCurrentRaycast.gameObject.name == "EqSlot(Clone)") { lastObject = eventData.pointerCurrentRaycast.gameObject.transform.GetChild(0).gameObject; if (eventData.pointerCurrentRaycast.gameObject.GetComponent <EquipSlot>().isEquip) { lastObject.SetActive(true); invoketime = Time.time; } else { lastObject.SetActive(false); } } else if (eventData.pointerCurrentRaycast.gameObject.name == "Removetext") { // Debug.Log(eventData.pointerCurrentRaycast.gameObject.transform.parent.parent); int tempitemid = eventData.pointerCurrentRaycast.gameObject.transform.parent.parent.GetComponent <EquipSlot>().EquipSlotItem.attributeid; EquipMG.PutEquipToBag(eventData.pointerCurrentRaycast.gameObject.transform.parent.parent.GetComponent <EquipSlot>().Eqslotid, tempitemid); InventoryMG.MGAddToBag(eventData.pointerCurrentRaycast.gameObject.transform.parent.parent.GetComponent <EquipSlot>().EquipSlotItem, 0); } else { lastObject.SetActive(false); } }
private void Awake() { if (instance != null) { Destroy(this); } instance = this; }
private void PutToEquipPos(item thisitem, int itemid, int slotid) { //if (itemid == slotid) //{ item RemovedEquip = EquipMG.GetEquipFromBag(thisitem, slotid); if (RemovedEquip != null) { InventoryMG.MGAddToBag(RemovedEquip, 0); } thisitem.itemHeld -= 1; InventoryMG.reflashbag(0); //} }