Exemple #1
0
 void DropRecipe(int index)
 {
     Recipe.Type recipe = GameManager.instance.hudManager.GetCookedRecipeOnSlotIndex(index);
     if (recipe != null)
     {
         if (recipe.Equals(Recipe.Type.Sponge))
         {
             Instantiate(sponge, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.ChocolateCake))
         {
             Instantiate(chocolateCake, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.ChocolateCookies))
         {
             Instantiate(chocolateCookie, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.Crepes))
         {
             Instantiate(crepes, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.Croissant))
         {
             Instantiate(croissant, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.Flan))
         {
             Instantiate(flan, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.StrawberryTart))
         {
             Instantiate(strawberryTart, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.SugarCookies))
         {
             Instantiate(sugarCookies, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.Waffles))
         {
             Instantiate(waffles, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.ChocolateShot))
         {
             Instantiate(chocolateShot, transform.position, Quaternion.identity);
         }
         else if (recipe.Equals(Recipe.Type.Pannatriffle))
         {
             Instantiate(pannatriffle, transform.position, Quaternion.identity);
         }
         GameManager.instance.hudManager.RemoveCookedRecipe(recipe);
     }
 }
        //ctor
        public MainWindow()
        {
            InitializeComponent();

            m_recipes       = manager.Recipes;
            m_actualRecipes = m_recipes;

            m_totalRecipeQuantity  = manager.GetAmountOfRecipes();
            m_actualRecipeQuantity = m_totalRecipeQuantity;

            ShowRecipe(0);
            m_actualIndex = 0;

            LabelShownRecipes.Content = "Wyświetlono wszystkie " + m_totalRecipeQuantity.ToString() + " przepisów!";

            int actualTime = DateTime.Now.Hour;

            if (actualTime > 5 && actualTime < 12)
            {
                m_actualTypeOfDinner = Recipe.Type.Sniadanie;
            }
            else if (actualTime > 12 && actualTime < 17)
            {
                m_actualTypeOfDinner = Recipe.Type.Obiad;
            }
            else
            {
                m_actualTypeOfDinner = Recipe.Type.Kolacja;
            }


            string dinnerType = "";

            if (m_actualTypeOfDinner == Recipe.Type.Sniadanie)
            {
                dinnerType = "śniadanie";
            }
            else if (m_actualTypeOfDinner == Recipe.Type.Obiad)
            {
                dinnerType = "obiad";
            }
            else if (m_actualTypeOfDinner == Recipe.Type.Kolacja)
            {
                dinnerType = "kolację";
            }

            RandomDinnerButton.Content = "Zaproponuj " + dinnerType;
        }
Exemple #3
0
 Sprite GetSpriteForRecipeType(Recipe.Type recipeType)
 {
     if (recipeType.Equals(Recipe.Type.ChocolateCake))
     {
         return(chocolateCake);
     }
     else if (recipeType.Equals(Recipe.Type.ChocolateCookies))
     {
         return(chocolateCookie);
     }
     else if (recipeType.Equals(Recipe.Type.ChocolateShot))
     {
         return(chocolateShot);
     }
     else if (recipeType.Equals(Recipe.Type.Crepes))
     {
         return(crepes);
     }
     else if (recipeType.Equals(Recipe.Type.Croissant))
     {
         return(croissant);
     }
     else if (recipeType.Equals(Recipe.Type.Flan))
     {
         return(flan);
     }
     else if (recipeType.Equals(Recipe.Type.Sponge))
     {
         return(sponge);
     }
     else if (recipeType.Equals(Recipe.Type.StrawberryTart))
     {
         return(strawberryTart);
     }
     else if (recipeType.Equals(Recipe.Type.SugarCookies))
     {
         return(sugarCookies);
     }
     else if (recipeType.Equals(Recipe.Type.Waffles))
     {
         return(waffles);
     }
     else if (recipeType.Equals(Recipe.Type.Pannatriffle))
     {
         return(pannatriffle);
     }
     return(chocolateCake);
 }
Exemple #4
0
    void InitHUD()
    {
        scorePanel = hud.transform.Find("Score/RecipePapers").gameObject;
        score      = hud.transform.Find("Score/Text").GetComponent <Text> ();

        mainPanel  = GameObject.Find("Main Menu");
        playButton = GameObject.Find("Play Button").GetComponent <Button>();

        recipeSlots     = new Image[4];
        recipeSlots [0] = hud.transform.Find("Cooked Recipes/Slot 1/Recipe").GetComponent <Image>();
        recipeSlots [1] = hud.transform.Find("Cooked Recipes/Slot 2/Recipe").GetComponent <Image>();
        recipeSlots [2] = hud.transform.Find("Cooked Recipes/Slot 3/Recipe").GetComponent <Image>();
        recipeSlots [3] = hud.transform.Find("Cooked Recipes/Slot 4/Recipe").GetComponent <Image>();

        ingredientSlots = new Dictionary <Ingredient.Type, Text> ();

        ingredientSlots.Add(Ingredient.Type.Butter, hud.transform.Find("Ingredients/Row/Butter").GetComponentInChildren <Text>());
        ingredientSlots.Add(Ingredient.Type.Sugar, hud.transform.Find("Ingredients/Row/Sugar").GetComponentInChildren <Text>());
        ingredientSlots.Add(Ingredient.Type.Flour, hud.transform.Find("Ingredients/Row/Flour").GetComponentInChildren <Text>());
        ingredientSlots.Add(Ingredient.Type.Egg, hud.transform.Find("Ingredients/Row/Egg").GetComponentInChildren <Text>());
        ingredientSlots.Add(Ingredient.Type.Milk, hud.transform.Find("Ingredients/Row2/Milk").GetComponentInChildren <Text>());
        ingredientSlots.Add(Ingredient.Type.Strawberry, hud.transform.Find("Ingredients/Row2/Strawberry").GetComponentInChildren <Text>());
        ingredientSlots.Add(Ingredient.Type.Chocolate, hud.transform.Find("Ingredients/Row2/Chocolate").GetComponentInChildren <Text>());
        ingredientSlots.Add(Ingredient.Type.Cream, hud.transform.Find("Ingredients/Row2/Cream").GetComponentInChildren <Text>());

        cookingPanel = hud.transform.Find("Cooking Panel").gameObject;

        ingredientCookingButtons     = new Dictionary <Ingredient.Type, Button> ();
        ingredientCookingButtonsText = new Dictionary <Ingredient.Type, Text> ();

        ingredientCookingButtons.Add(Ingredient.Type.Butter, cookingPanel.transform.Find("Ingredients/Row/Butter").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Butter, cookingPanel.transform.Find("Ingredients/Row/Butter").GetComponentInChildren <Text>());
        ingredientCookingButtons.Add(Ingredient.Type.Sugar, cookingPanel.transform.Find("Ingredients/Row/Sugar").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Sugar, cookingPanel.transform.Find("Ingredients/Row/Sugar").GetComponentInChildren <Text>());
        ingredientCookingButtons.Add(Ingredient.Type.Flour, cookingPanel.transform.Find("Ingredients/Row/Flour").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Flour, cookingPanel.transform.Find("Ingredients/Row/Flour").GetComponentInChildren <Text>());
        ingredientCookingButtons.Add(Ingredient.Type.Egg, cookingPanel.transform.Find("Ingredients/Row/Egg").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Egg, cookingPanel.transform.Find("Ingredients/Row/Egg").GetComponentInChildren <Text>());
        ingredientCookingButtons.Add(Ingredient.Type.Milk, cookingPanel.transform.Find("Ingredients/Row2/Milk").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Milk, cookingPanel.transform.Find("Ingredients/Row2/Milk").GetComponentInChildren <Text>());
        ingredientCookingButtons.Add(Ingredient.Type.Strawberry, cookingPanel.transform.Find("Ingredients/Row2/Strawberry").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Strawberry, cookingPanel.transform.Find("Ingredients/Row2/Strawberry").GetComponentInChildren <Text>());
        ingredientCookingButtons.Add(Ingredient.Type.Chocolate, cookingPanel.transform.Find("Ingredients/Row2/Chocolate").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Chocolate, cookingPanel.transform.Find("Ingredients/Row2/Chocolate").GetComponentInChildren <Text>());
        ingredientCookingButtons.Add(Ingredient.Type.Cream, cookingPanel.transform.Find("Ingredients/Row2/Cream").GetComponentInChildren <Button>());
        ingredientCookingButtonsText.Add(Ingredient.Type.Cream, cookingPanel.transform.Find("Ingredients/Row2/Cream").GetComponentInChildren <Text>());

        recipeText = cookingPanel.transform.Find("Recipe/Recipe").GetComponent <Text> ();
        cookButton = cookingPanel.transform.Find("Cook/Cook Button").GetComponent <Button> ();

        cookedRecipes = new List <Recipe.Type> ();
        recipe        = new Dictionary <Ingredient.Type, int> ();

        cookButton.onClick.AddListener(() => {
            Recipe.Type validRecipe = EvaluateRecipe();
            if (validRecipe != Recipe.Type.None)
            {
                if (cookedRecipes.Count < 4)
                {
                    cookedRecipes.Add(validRecipe);
                    SubstractUsedIngredients();
                    Debug.Log("Successfully cooked a new recipe! " + validRecipe.ToString());
                    UpdateCookedRecipes();
                    LaunchCooking();
                    SoundManager.instance.PlaySingle(uuuhSound);
                }
            }
            else
            {
                SoundManager.instance.PlaySingle(nopeSound1);
                LaunchCooking();
            }
        });

        roomIndicator = hud.transform.Find("Room Indicator").GetComponent <Text> ();

        InitIngredientCookingButtons();
        UpdateIngredientCookingButtonsText();

        mainPanel.SetActive(true);
    }
Exemple #5
0
 public void RemoveCookedRecipe(Recipe.Type recipe)
 {
     cookedRecipes.Remove(recipe);
     UpdateCookedRecipes();
 }