示例#1
0
 //Removes item after using it
 public void removeItem(PICK_UP item)
 {
     if (itemsInIventory[item] > 0)
     {
         itemsInIventory[item] = itemsInIventory[item] - 1;
     }
 }
示例#2
0
    //Checks if the players has the determined item
    public bool hasRequiredObject(PICK_UP item)
    {
        int amount = 0;

        itemsInIventory.TryGetValue(item, out amount);
        return(amount > 0);
    }
示例#3
0
    // Start is called before the first frame update
    void Start()
    {
        //Initialize Dictionary
        var values = PICK_UP.GetValues(typeof(PICK_UP));

        foreach (PICK_UP val in values)
        {
            itemsInIventory.Add(val, 0);
        }
        itemsInIventory[PICK_UP.WRENCH] = 1;
    }
示例#4
0
    public void pickUpGem(PICK_UP gemType)
    {
        switch (gemType)
        {
        default:
        case (PICK_UP.BLUE_GEM):
            Destroy(blueGemBubble);
            portal.GetComponent <SwirlControl>().pickedBlue();
            break;

        case (PICK_UP.RED_GEM):
            Destroy(redGemBubble);
            portal.GetComponent <SwirlControl>().pickedRed();
            break;

        case (PICK_UP.GREEN_GEM):
            Destroy(greenGemBubble);
            portal.GetComponent <SwirlControl>().pickedGreen();
            break;
        }
    }