Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //if the slot got an item
- else if (draggingItem.slot != slotID)
- {
- //get the slot that currently have item
- ItemDragHandler thisSlotItem = this.transform.GetChild(0).GetComponent<ItemDragHandler>(); //the only things in slot
- thisSlotItem.slot = draggingItem.slot; // 3->2 DIS
- thisSlotItem.transform.SetParent(inv2.slots[draggingItem.slot].transform);
- thisSlotItem.transform.position = inv2.slots[draggingItem.slot].transform.position;
- //changing the item drag to current slot that have been pointed
- draggingItem.slot = slotID; // 2->3 DIS
- draggingItem.transform.SetParent(this.transform);
- draggingItem.transform.position = this.transform.position;
- //zzzz the item swap wrong becoz the slot is edy change in the first place ==
- inv2.items[thisSlotItem.slot] = thisSlotItem.item;
- inv2.items[draggingItem.slot] = draggingItem.item;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement