Esempio n. 1
0
 public void AddIngredient(PizzaIngredient.PizzaInredientType newIngredient)
 {
     if (getPizzaType(AddedIngredients) != PizzaType.wrong)
     {
         AddedIngredients.Add(newIngredient);
         SetToppinged();
     }
 }
Esempio n. 2
0
    public Sprite GetSprite(PizzaIngredient.PizzaInredientType ingredient)
    {
        var i = ingredients.Where(a => a.name == ingredient).FirstOrDefault();

        if (i != null)
        {
            return(i.sprite);
        }
        else
        {
            Debug.LogError("Ingredient not found?");
            return(null);
        }
    }
Esempio n. 3
0
    private IEnumerator ProgressPizzaCo(float wait, PizzaIngredient.PizzaInredientType ingredient)
    {
        var ps = PizzaSocket.OccupiedBy.GetComponentInChildren <Pizza>();

        if (ps == null)
        {
            Debug.LogError("Pizza script missing?");
        }
        var i = ps.GetComponent <Interactable>();

        isCurrentlyWorking = true;
        i.isLocked         = true;

        yield return(new WaitForSeconds(wait));

        ps.AddIngredient(ingredient);
        i.isLocked         = false;
        isCurrentlyWorking = false;
        Activate(); // Try to activate again, in case an ingredient was placed while working
    }
Esempio n. 4
0
    public PizzaIngredient.PizzaInredientType RandomTopping()
    {
        PizzaIngredient.PizzaInredientType topping = AnyRandomTopping();

        // No special meat early in the game
        if (gameManager.currentGameStage == GameManager.GameStage.early)
        {
            while (topping == PizzaIngredient.PizzaInredientType.Cheese || topping == PizzaIngredient.PizzaInredientType.Sauce || topping == PizzaIngredient.PizzaInredientType.SpecialMeat)
            {
                topping = AnyRandomTopping();
            }
        }
        else
        {
            while (topping == PizzaIngredient.PizzaInredientType.Cheese || topping == PizzaIngredient.PizzaInredientType.Sauce)
            {
                topping = AnyRandomTopping();
            }
        }

        return(topping);
    }