Exemplo n.º 1
0
    private void SetIngredientGraphic()
    {
        Sprite toLoad = Resources.Load <Sprite>(ingredient.ToString());

        if (toLoad)
        {
            GetComponent <SpriteRenderer>().sprite = toLoad;
        }
        else
        {
            //Debug.LogError("Sprite " + ingredient.ToString() + " not found");
            GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("DefaultIngr");
        }
    }
Exemplo n.º 2
0
    //could do it one one burst with items added, but then wouldn't have the proper colors tells.
    public void AddIngredient(Globals.product addedIngredient)
    {
        Debug.Log("added ingr: " + addedIngredient.ToString());
        if (!itemsAdded.ContainsKey(addedIngredient))
        {
            itemsAdded.Add(addedIngredient, 0);
        }
        itemsAdded[addedIngredient]++;

        foreach (Element e in IngredientToElementDictionary.Instance.ElementsFromIngredient(addedIngredient))
        {
            //Debug.Log("elem e consists of " + e.energyType + ", " + e.power);
            if (!energyStored.ContainsKey(e.energyType))
            {
                energyStored.Add(e.energyType, e.power);
            }
            else
            {
                energyStored[e.energyType] += e.power;
            }
        }
    }