Esempio n. 1
0
 public void Init(Ingredient ingredient)
 {
     Ingredient = ingredient;
     var spritePath = ResourcePaths.ICONS_RESOURCE_ROOT + string.Format ("icon_{0}", ingredient.IngredientID);
     var sprite = ResourceLoader.GetResource<Sprite> (spritePath);
     if (sprite != null)
     {
         SpriteRenderer.sprite = sprite;
     }
 }
Esempio n. 2
0
        public int AddIngredient(string ingredientID)
        {
            Ingredient ingredient;
            if (!Ingredients.TryGetValue (ingredientID, out ingredient)) {
                ingredient = new Ingredient
                {
                    IngredientID = ingredientID
                };

                Ingredients.Add(ingredientID, ingredient);
            }

            ingredient.Amount++;

            return ingredient.Amount;
        }