Beispiel #1
0
 public void OnDrop(PointerEventData eventData)
 {
     // verify if item being dragged is not null
     if ((InventoryItemDragHandler.itemBeingDragged != null)
         // verify if we are in edit screen mode
         && (transform.root.Find("MiscUI").GetComponentInChildren <EditPartyScreen>(false) != null))
     {
         Debug.Log("Find or create the right slot and put an item into it");
         // Get empty slot
         ItemSlotDropHandler itemSlot = GetEmptySlot();
         // verify if slot is not null
         if (itemSlot == null)
         {
             // get PartyInventoryUI
             PartyInventoryUI partyInventoryUI = GetComponentInParent <PartyInventoryUI>();
             // create new slot
             itemSlot = partyInventoryUI.AddSlot();
         }
         // move item drag handler into slot
         itemSlot.MoveItemIntoThisSlot();
     }
 }