/// <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); }
/// <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) { }
/// <summary> /// Slots have changed.</summary> public virtual void SlotChanged(Slot slot, SlottableItem currentItem, SlottableItem previousItem) { }
/// <summary> /// Weather the Item accepts the given Slot.</summary> public bool AcceptsSlot(Slot slot) { return(true); }
/// <summary> /// Weather the Item accepts the given Slot.</summary> public virtual bool AcceptsSlot(Slot slot) { return true; }