Beispiel #1
0
    public IEnumerator RunDialogueAndWaitForConfirmation()
    {
        yield return(StartCoroutine(TownDialogueBox.RunDialogue(Dialogue, false)));

        Controller.Confirmation.SetActive(true);
        yield return(StartCoroutine(WaitForConfirmation()));

        string choiceMade = Controller.ConfirmationChoice;

        Controller.ConfirmationChoice = "";
        if (choiceMade == "Yes")
        {
            DataManager.instance.LoadNextScene(NextScene);
        }
        else if (choiceMade == "No")
        {
            Controller.Confirmation.SetActive(false);
            Controller.TextBoxBackground.SetActive(false);
        }
        else
        {
            Debug.Log("Confirmation choice not Yes or No");
            Controller.Confirmation.SetActive(false);
            Controller.TextBoxBackground.SetActive(false);
        }
    }
Beispiel #2
0
    public void ActionsOnClick()
    {
        if (Controller.IsRunningDialogue == true)
        {
            return;
        }

        if (TalkedTo == false)
        {
            TalkedTo = true;
            SpeechBubbleImageTalkedTo(true);
            Controller.SaveTownState();
            DataManager.instance.LoadNextScene(DialogueScene);
        }
        else
        {
            StartCoroutine(TownDialogueBox.RunDialogue(TalkedToDialogue));
        }
    }