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()); } } }
private void Update() { if (Input.GetMouseButtonDown(MouseButton.MIDDLE)) { InventoryItem craftedItem = craftingObject.Craft(playerInventory); if (craftedItem != null) { playerInventory.AddItem(craftedItem); } } }
public void CraftItem() { var upgrade = Item.Craft(Inventory); if (upgrade) { Item = upgrade; UpdateUI(); } else { gameObject.SetActive(false); } }