public void UpdateUIText(Ingredient ingredient) { foreach (GameObject child in uiElements) { if (child.name == ingredient.Type.ToString()) { child.transform.GetChild(1).GetComponent <TextMeshProUGUI>().text = shaker.GetIngredientAmount(ingredient) + ""; } } }