public void UnEquipItem() { playerEquippedItems.RemoveItemFromEquippedItems(equippedItem); if (equippedItem.stackable == true) { if (playerInventory.ContainsItemInStack(equippedItem)) { playerInventory.IncItemStackNumber(equippedItem); characterInventoryChanged.boolState = true; } else { playerInventory.itemsList.Add(equippedItem); characterInventoryChanged.boolState = true; } } else { playerInventory.itemsList.Add(equippedItem); characterInventoryChanged.boolState = true; } ResetSlot(); playerEquippedItems.equippedItems.Remove((EquippableItem)equippedItem); equippedItemsChanged.boolState = true; }
void AddItem(Item itemToAdd, CharacterItemsList shopList) { //Debug.Log(itemToAdd.name + "added"); if (shopList.itemsList.Contains(itemToAdd) && itemToAdd.stackable == true) { if (shopList.ContainsItemInStack(itemToAdd)) { shopList.IncItemStackNumber(itemToAdd); } else { shopList.AddItemToStack(itemToAdd); shopList.IncItemStackNumber(itemToAdd); } } else { shopList.itemsList.Add(itemToAdd); shopList.AddItemToStack(itemToAdd); } }