예제 #1
0
 public void OnDrop(PointerEventData eventData)
 {
     if (eventData.pointerDrag != null && hasItem == false)
     {
         currentItem = eventData.pointerDrag;
         DragDrop dragDrop = currentItem.GetComponent <DragDrop>();
         dragDrop.onSlot = true;
         currentItem.GetComponent <RectTransform>().anchoredPosition = GetComponent <RectTransform>().anchoredPosition;
         hasItem = true;
         dragDrop.AssignItemSlot(this.gameObject);
         if (CombineItems != null && currentItem.GetComponent <IngredientDisplay>() != null)
         {
             CombineItems.CreateItem(currentItem.GetComponent <IngredientDisplay>().ingredient);
         }
     }
 }