public void setRecipe() { if (productNamesByIndex [findCraftingCategoryIndexByName(craftingCategory)].Length > craftingIndex) { craftingSlot1.GetComponent <CraftingRecipeScript> ().myRecipe = playerInventoryScript.findRecipeWithProductName(productNamesByIndex [findCraftingCategoryIndexByName(craftingCategory)] [craftingIndex]); craftingSlot1.GetComponent <CraftingRecipeScript> ().updateImage(true); } else { craftingSlot1.GetComponent <CraftingRecipeScript> ().updateImage(false); } if (productNamesByIndex [findCraftingCategoryIndexByName(craftingCategory)].Length > craftingIndex + 1) { craftingSlot2.GetComponent <CraftingRecipeScript> ().myRecipe = playerInventoryScript.findRecipeWithProductName(productNamesByIndex [findCraftingCategoryIndexByName(craftingCategory)] [craftingIndex + 1]); craftingSlot2.GetComponent <CraftingRecipeScript> ().updateImage(true); } else { craftingSlot2.GetComponent <CraftingRecipeScript> ().updateImage(false); } if (productNamesByIndex [findCraftingCategoryIndexByName(craftingCategory)].Length > craftingIndex + 2) { craftingSlot3.GetComponent <CraftingRecipeScript> ().myRecipe = playerInventoryScript.findRecipeWithProductName(productNamesByIndex [findCraftingCategoryIndexByName(craftingCategory)] [craftingIndex + 2]); craftingSlot3.GetComponent <CraftingRecipeScript> ().updateImage(true); } else { craftingSlot3.GetComponent <CraftingRecipeScript> ().updateImage(false); } }