public void Craft()
    {
        if (recip == null)
        {
            StartCoroutine(Alert());
        }
        InventoryItem i = recip.Craft(inv);

        if (i != null)
        {
            inv.AddItem(i);
        }
        else
        {
            if (recip.Recipe.OutputItem.ItemData.itemName == "Dash1")
            {
                GetComponent <PlayerUnlocking>().Dash = true;
                D1.enabled = false;
            }
            else if (recip.Recipe.OutputItem.ItemData.itemName == "Dash2")
            {
                GetComponent <PlayerUnlocking>().Dash2 = true;
                D2.enabled = false;
            }
            else
            {
                StartCoroutine(Alert());
            }
        }
    }
示例#2
0
 void OnPlayerUse()
 {
     if (!isOpen)
     {
         isOpen = true;
         inventoryManager.AddItem(contents);
     }
 }
示例#3
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(MouseButton.MIDDLE))
     {
         InventoryItem craftedItem = craftingObject.Craft(playerInventory);
         if (craftedItem != null)
         {
             playerInventory.AddItem(craftedItem);
         }
     }
 }