Esempio n. 1
0
        public IEnumerator SelectRecipeRoutine()
        {
            RecipeSelectionDialog dialog = FindObjectOfType <RecipeSelectionDialog>();

            dialog.Show();
            dialog.SetNone();
            dialog.PopulateRecipes();

            while (!dialog.IsFinished() && !dialog.IsCancel())
            {
                yield return(null);
            }

            if (dialog.IsFinished())
            {
                recipe.text = !string.IsNullOrEmpty(dialog.GetSelectedRecipe()) ? dialog.GetSelectedRecipe() : dialog.GetFreeTextRecipeName();
                string          recipeName = string.IsNullOrEmpty(recipe.text) ? " " : recipe.text;
                JSONObject      body       = JsonBody.AddToPlanner(recipeName, day.ToString());
                UnityWebRequest request    = Postman.CreatePutRequest(Endpoints.instance.PLANNER(), body.ToString());
                yield return(request.SendWebRequest());

                yield break;
            }
        }
Esempio n. 2
0
 public void SetParentDialog(RecipeSelectionDialog dialog)
 {
     this.dialog = dialog;
 }