示例#1
0
 /// <summary>
 /// Catch the current Slot.
 /// Parent the Item under the Canvas in order to have it in
 /// front of everything while dragging.</summary>
 public void OnBeginDrag(PointerEventData eventData)
 {
     if (!_slot._allowsDrag)
     {
         return;
     }
     _canvas = GetComponentInParent<Canvas>();
     _draggedItem = this;
     startSlot = _slot;
     GetComponent<CanvasGroup>().blocksRaycasts = false;
     transform.SetParent(GetComponentInParent<Canvas>().transform);
 }
示例#2
0
 /// <summary>
 /// Update the Character in case the Item is placed in a special
 /// Slot, like the Weapon Slot.</summary>
 public void SlotChanged(Slot slot, SlottableItem currentItem, SlottableItem previousItem)
 {
 }
示例#3
0
 /// <summary>
 /// Slots have changed.</summary>
 public virtual void SlotChanged(Slot slot,
                                  SlottableItem currentItem,
                                  SlottableItem previousItem)
 {
 }
示例#4
0
 /// <summary>
 /// Weather the Item accepts the given Slot.</summary>
 public bool AcceptsSlot(Slot slot)
 {
     return(true);
 }
示例#5
0
 /// <summary>
 /// Weather the Item accepts the given Slot.</summary>
 public virtual bool AcceptsSlot(Slot slot)
 {
     return true;
 }