Exemple #1
0
    public void setIngredientItem(IIngredientInventoryItem item)
    {
        Start();

        selectedItem = item;
        display.setIngredient(item.ingredient);
        if (item is IngredientInventoryItemShop)
        {
            IngredientInventoryItemShop shopItem = (IngredientInventoryItemShop)item;
            costText.text = "$" + (shopItem.cost / 100.0).ToString("0.00");
            updateEnableBuyButton(moneyLibrary.getMoney());
            buyButton.gameObject.SetActive(true);
        }
        else
        {
            costText.text = "";
            buyButton.gameObject.SetActive(false);
        }
    }
Exemple #2
0
 private void ingredientSelected(IngredientHolder ingredientHolder)
 {
     board.setIngredient(ingredientHolder.ingredient);
     if (selectedIngredient != ingredientHolder.ingredient)
     {
         selectedIngredientDisplay.setIngredient(ingredientHolder.ingredient);
     }
     selectedIngredient = ingredientHolder.ingredient;
     foreach (IngredientHolder holder in selectors)
     {
         if (holder == ingredientHolder)
         {
             holder.GetComponent <ColorOnHover>().setSelected(true);
         }
         else
         {
             holder.GetComponent <ColorOnHover>().setSelected(false);
         }
     }
 }