Exemplo n.º 1
0
    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;
    }
Exemplo n.º 2
0
    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);
        }
    }