Пример #1
0
 public void unlockBox()
 {
     handler.StartSceneFromLock(keyedText);
     opened = true;
     itemReceivedStinger.PlayOneShot((AudioClip)Resources.Load("Sounds/ItemFound"));
     sr.sprite = openedSprite;
     choiceMenuScript.closeMenu();
     pd.RemoveItem(keyId);
     pd.GiveItem(itemId);
     itemMenuScript.UpdateButtons();
 }
Пример #2
0
    public void equipItem()
    {
        ItemType it = pd.masterItemDirectory.dir[(int)pd.items[curItem]].type;

        if (it == ItemType.weapon || it == ItemType.accessory)
        {
            if (pd.equippedItems.Contains(curItem) || pd.equippedItems.Count < pd.equipSlots)
            {
                pd.equipItem(curItem);
                UpdateButtons();
            }
            else
            {
                a    = "No more equip slots! Dequip an item first!";
                b[0] = a;
                handler.StartSceneFromLock(b);
                ToggleItemDetails();
            }
        }
        else if (it == ItemType.consumable)
        {
            pd.updateEquippedItems(curItem);
            pd.applyConsumable(pd.masterItemDirectory.dir[(int)pd.items[curItem]]);
            a = "Used a " + pd.masterItemDirectory.dir[(int)pd.items[curItem]].name;
            pd.items.RemoveAt(curItem);
            b[0] = a;
            handler.StartSceneFromLock(b);
            ToggleItemDetails();
        }
        else if (it == ItemType.key)
        {
            a    = "Can't use that here!";
            b[0] = a;
            handler.StartSceneFromLock(b);
            ToggleItemDetails();
        }

        // UpdateItemInfo(curItem);
    }