Example #1
0
    public float getCooktime(Cooking.cooktype type)
    {
        foreach (SingleRecipe s in myRecipes)
        {
            if (s.requires == type)
            {
                return(s.durationOfCooking);
            }
        }

        return(-1);
    }
Example #2
0
    public GameObject FinishCooking(Cooking.cooktype type)
    {
        foreach (SingleRecipe s in myRecipes)
        {
            if (s.requires == type)
            {
                GameObject next = Instantiate(s.becomes);
                next.transform.position = transform.position;
                if (type == Cooking.cooktype.Baking)
                {
                    next.GetComponent <AudioSource>().PlayOneShot(bakingSFX);
                }
                return(next);
            }
        }

        print("Cooking finished, but no recipe of correct type was found?");
        return(null);
    }