public void SetRecipeText(Slot[] slots) { if (recipeElements.Count > 0) { recipeText.text = String.Empty; string greenColor = "green"; string redColor = "red"; for (int i = 0; i < recipeElements.Count; i++) { //colors if (slots[recipeElements[i].indexElementFromSlotsList].count >= recipeElements[i].count * slotLevel) { recipeText.text += "<b><color=" + greenColor + ">" + (ShortScaleString.parseDoubleForRecipeText(slots[recipeElements[i].indexElementFromSlotsList].count)) + "/" + ShortScaleString.parseDoubleForRecipeText(recipeElements[i].count * slotLevel) + "</color></b>" + " "; } else { recipeText.text += "<b><color=" + redColor + ">" + (ShortScaleString.parseDoubleForRecipeText(slots[recipeElements[i].indexElementFromSlotsList].count)) + "/" + ShortScaleString.parseDoubleForRecipeText(recipeElements[i].count * slotLevel) + "</color></b>" + " "; } //recipeText.text += recipeElements[i].name; string iconName = recipeElements[i].name.ToLower() + "Icon"; recipeText.text += "<sprite=\"" + iconName + "\" index=0>"; if (i != (recipeElements.Count - 1)) { recipeText.text += " + "; } } } }