示例#1
0
 /// <summary>
 /// On any item drag start need to disable all items raycast for correct drop operation.
 /// </summary>
 /// <param name="item"> dragged item </param>
 private void OnAnyItemDragStart(GameObject item)
 {
     if (myDadItem != null)
     {
         myDadItem.MakeRaycast(false);                                               // Disable item's raycast for correct drop handling
     }
 }
示例#2
0
 /// <summary>
 /// Put item into this cell.
 /// </summary>
 /// <param name="item">Item.</param>
 /// <param name="destroyOldItem">If set to <c>true</c> destroy old item.</param>
 private void PlaceItem(GameObject item, bool destroyOldItem)
 {
     if (item != null)
     {
         if (destroyOldItem == true)
         {
             DestroyItem();                                                                  // Remove current item from this cell
             myDadItem = null;
         }
         DadItem dadItem = item.GetComponent <DadItem>();
         if (dadItem != null)
         {
             // Put new item into this cell
             item.transform.SetParent(transform, false);
             item.transform.localPosition = Vector3.zero;
             dadItem.MakeRaycast(true);
             myDadItem = dadItem;
         }
     }
     UpdateBackgroundState();
 }