Ejemplo n.º 1
0
 // Only use in Inventory
 private void dropItem(ItemIcon itemIcon, int itemIndex, Item currentItem)
 {
     inventoryList.Remove(currentItem);
     invItemIdList.Add(currentItem.getInvItemId());
     ItemPrefab.instance.dropObj(currentItem.getItemType(), itemIndex);
     itemIcon.resetItemIcon();
 }
Ejemplo n.º 2
0
    // DropItem Funcitons
    // For param@ ItemDragHandler Actions
    public void dropItem(ItemIcon itemIcon)
    {
        int  invItemId   = itemIcon.getInvItemId();
        Item droppedItem = inventoryList.Find(item => item.getInvItemId() == invItemId);

        inventoryList.Remove(droppedItem);
        invItemIdList.Add(invItemId);
        ItemPrefab.instance.dropObj(droppedItem.getItemType(), invItemId);
        itemIcon.resetItemIcon();
    }
Ejemplo n.º 3
0
    // Remove specific item
    public void removeItem(Item item)
    {
        int           invItemId = item.getInvItemId();
        InventorySlot invSlot   = inventorySlotList.Find(slot => slot.itemIcon.getInvItemId() == invItemId);
        ItemIcon      itemIcon  = invSlot.itemIcon;

        inventoryList.Remove(item);
        invItemIdList.Add(invItemId);
        ItemPrefab.instance.destroyObj(invItemId);
        itemIcon.resetItemIcon();
    }
Ejemplo n.º 4
0
    public void removeCurrentItem()
    {
        ItemIcon itemIcon    = inventorySlotList[currentItemNo].itemIcon;
        int      invItemId   = itemIcon.getInvItemId();
        Item     currentItem = inventoryList.Find(item => item.getInvItemId() == invItemId);

        inventoryList.Remove(currentItem);
        invItemIdList.Add(invItemId);
        ItemPrefab.instance.destroyObj(invItemId);
        itemIcon.resetItemIcon();
    }