Esempio n. 1
0
    public void ExecuteCloseBackpack()
    {
        elementScroller.ScrollElements(80.0f);
        elementScroller.DisableAddedButtons();

        AddTextElement("You closed your backpack.");
        AddDungeonRoomOptions();
        OpenBackpackButton.Instance().EnableButton();
    }
Esempio n. 2
0
    public void ExecutePickedItem(ItemType item)
    {
        inventory.equippedItem = item;

        elementScroller.ScrollElements(80.0f);
        elementScroller.DisableAddedButtons();

        AddTextElement("Equipped " + SplitCamelCase(item.ToString()) + ".");
        AddDungeonRoomOptions();
        OpenBackpackButton.Instance().EnableButton();
    }
Esempio n. 3
0
    public void OpenBackpack()
    {
        elementScroller.ScrollElements(80.0f);
        elementScroller.DisableAddedButtons();

        string openBackpackText = "You opened your backpack but there is nothing in there.";

        int itemCount = inventory.availableItems.Count;

        if (itemCount > 0)
        {
            openBackpackText = "In your backpack you can find: ";

            int iteratedCount = 0;
            foreach (ItemType item in inventory.availableItems)
            {
                openBackpackText += SplitCamelCase(item.ToString());
                if (inventory.equippedItem == item)
                {
                    openBackpackText += " (equipped)";
                }

                ++iteratedCount;

                if (iteratedCount < itemCount)
                {
                    openBackpackText += " | ";
                }
            }
        }

        AddTextElement(openBackpackText);
        if (itemCount > 0)
        {
            GameObject equipButtonGO = AddButtonElement("Equip item");
            equipButtonGO.GetComponent <DungeonRoomOptionButton>().buttonEventType = ButtonEventType.EquipItem;
        }

        GameObject closeBackpackButtonGO = AddButtonElement("Close backpack");

        closeBackpackButtonGO.GetComponent <DungeonRoomOptionButton>().buttonEventType = ButtonEventType.CloseBackpack;

        OpenBackpackButton.Instance().DisableButton();
    }