//Gets a specified dish from the menu script public MenuScript.Dish SelectDish(string name) { currentDish = GetDish(name); SpawnIngredients(); return(currentDish); }
// Set ingredients based on dish public void SetStationIngredients(MenuScript.Dish dish) { for (int i = 0; i < ingredients.Length; i++) { //Key // 0 = Brain // 1 = Blood // 2 = Skull // 3 = Rat // 4 = Lice switch (dish.ingredients[i]) { case MenuScript.IngredientType.brain: ingredients[i].sprite = ingredientSprites[0]; break; case MenuScript.IngredientType.blood: ingredients[i].sprite = ingredientSprites[1]; break; case MenuScript.IngredientType.skull: ingredients[i].sprite = ingredientSprites[2]; break; case MenuScript.IngredientType.rat: ingredients[i].sprite = ingredientSprites[3]; break; case MenuScript.IngredientType.lice: ingredients[i].sprite = ingredientSprites[4]; break; } } }
//Gets a random dish from the menuscript and returns it public MenuScript.Dish SelectDish() { currentDish = GetDishRandom(); SpawnIngredients(); return(currentDish); }
private void SetupTicket() { //Gets the stations to show in the ticket SetTargetStations(); //Gets which dish from the menu is currently being made menuDish = ingredientSpawner.GetComponent <IngredientSpawner>().CurrentDish; //Gets the ingredients to show in the ticket SetTargetIngredients(); //Sets the sprites on the ticket script ticketManager.SetStationIngredients(menuDish); ticketManager.SetDish(); }