public void DropSelected() { if (_currentlySelectedLocation == EquipLocation.None) { return; } //Gets the item EquipableItem item = GetItemInSlot(_currentlySelectedLocation); //Drops the item GameObject.FindGameObjectWithTag("Player").GetComponent <ItemDropper>().DropItem(item, 1); //Closes the tooltip ItemTooltip tooltip = GameObject.FindObjectOfType <ItemTooltip>(); if (tooltip) { tooltip.Close(); } //Removes the item RemoveItem(_currentlySelectedLocation); //Sets the selected to none _currentlySelectedLocation = EquipLocation.None; }
private void InventorySlotSelected(int slotId) { if (slotId >= 0) { _itemTooltip.Open(_itemList[slotId].item, _itemTooltip.RectPosition); } else { _itemTooltip.Close(); } }
private void InventorySlotSelected(int slotId) { if (slotId >= 0) { _itemTooltip.Open(_invItems[slotId].item, _inventory.GetSlotPosition(slotId)); } else { _itemTooltip.Close(); } }