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()); } } }
void OnPlayerUse() { if (!isOpen) { isOpen = true; inventoryManager.AddItem(contents); } }
private void Update() { if (Input.GetMouseButtonDown(MouseButton.MIDDLE)) { InventoryItem craftedItem = craftingObject.Craft(playerInventory); if (craftedItem != null) { playerInventory.AddItem(craftedItem); } } }