public void Unstack() { var initialAmount = ItemToUnstack.Quantity; var amountLeft = initialAmount - (int)SelectedAmount; //prepare and add new item var newItemToAdd = InventoryBehaviour.ItemDatabase.getItemByID(ItemToUnstack.Id); newItemToAdd.Quantity = (int)SelectedAmount; InventoryBehaviour.SetSelectedItemAmount(amountLeft); InventoryBehaviour.Add(newItemToAdd, false); InventoryBehaviour.DisableButtons(); Cancel(); }
public void CraftItem() { var item = OutputSlot.GetItem(); var inventoryItemToAdd = item.getCopy <Item>(); var emptySlot = InventoryBehavior.FindEmptySlot(); if (emptySlot != null) { InventoryBehavior.Add(item); if (tempRecipe != null) { RemoveRequiredItems(tempRecipe); } SetCraftUI(null); } else { //popup inventory is not empty; } }
public bool PickUpItem(Item item) { return(InventoryBehaviour.Add(item)); }