Beispiel #1
0
 public void ConfirmAnswer()
 {
     audio.Play("click");
     //Check if the ingredient is correct
     if (cauldron.CheckIngredients(theRecipe.currentIngrIndex))
     {
         //Move to next ingredient in the recipe
         if (theRecipe.currentIngrIndex + 1 < theRecipe.components.Count)
         {
             recipeDisplay.HideBorder(theRecipe.currentIngrIndex);
             Debug.Log("Moving to next component");
             theRecipe.currentIngrIndex++;
             cauldron.ResetCauldron();
             audio.Play("correct");
             //Next component
             recipeDisplay.HighlightCurrentComponent(theRecipe.currentIngrIndex);
         }
         else
         {
             //Recipe is complete
             audio.Play("success");
             Debug.Log("Recipe is done");
             NextRecipe();
         }
     }
     else
     {
         audio.Play("explosion");
         cauldron.ResetCauldron();
     }
 }
Beispiel #2
0
 public void ConfirmAnswer()
 {
     if (cauldron.CheckIngredients(theRecipe.currentIngrIndex))
     {
         //Move to next ingredient in the recipe
         if (theRecipe.currentIngrIndex + 1 < theRecipe.components.Count)
         {
             Debug.Log("Moving to next component");
             theRecipe.currentIngrIndex++;
             cauldron.ResetCauldron();
             //Next component
             recipeDisplay.HighlightCurrentComponent(theRecipe.currentIngrIndex);
         }
         else
         {
             //Recipe is complete
             Debug.Log("Recipe is done");
             NextRecipe();
         }
     }
     else
     {
         cauldron.ResetCauldron();
     }
 }