Exemple #1
0
    /// <summary>
    /// Create and add a new ingredient slot in the display.
    /// </summary>
    public void AddIngredient()
    {
        if (ingredientField.text != "")
        {
            GameObject     go      = Instantiate(ingredientSlotPrefab, ingredientListContainer);
            IngredientSlot newSlot = go.GetComponent <IngredientSlot>();

            newSlot.SetIngredient(this, ingredientField.text);
            ingredientSlots.Add(newSlot);

            ingredientField.text = "";
        }
    }
Exemple #2
0
 /// <summary>
 /// Remove the ingredient from the ingredient list.
 /// </summary>
 public void RemoveIngredient(IngredientSlot toRemove)
 {
     ingredientSlots.Remove(toRemove);
 }