public void OnDrop(PointerEventData eventData) { RectTransform inventPanel = transform as RectTransform; if (!RectTransformUtility.RectangleContainsScreenPoint(inventPanel, Input.mousePosition)) { BaseInventoryObject item = eventData.pointerDrag.gameObject.GetComponent <ItemDragHandler>().Item; if (item == null) { return; } if (!item.CanBePlaced()) { return; } ItemPlaced?.Invoke(item); } }
private void OnItemDroppedIn(ItemDroppedEventData data) { ItemPlaced?.Invoke(data.InventoryItem.Item); }
private void OnInventoryItemRightClicked(InventoryItem item) { ItemPlaced?.Invoke(item.Item); }