/// <summary>
    /// Identifies which UI button is pressed and links the button to corresponding
    /// actions.
    /// IF-statements advance the dialogue to the correspongding direction, and
    /// Update the information on the new dialogue slide to UI.
    /// The final IF-statement stores the out come to of the Dialogue to a variable
    /// </summary>
    /// <param name="button"></param>
    private void buttonPressed(Button button)
    {
        if (button == buttonDialogueOptionTop)
        {
            dialogueStorage.DialogueForward("optionTop");
            updateUISlideInfo();
        }
        else if (button == buttonDialogueOptionHigh)
        {
            dialogueStorage.DialogueForward("optionHigh");
            updateUISlideInfo();
        }
        else if (button == buttonDialogueOptionLow)
        {
            dialogueStorage.DialogueForward("optionLow");
            updateUISlideInfo();
        }
        else if (button == buttonDialogueOptionBottom)
        {
            dialogueStorage.DialogueForward("optionBottom");
            updateUISlideInfo();
        }

        if (dialogueStorage.GetCurrentSlide().GetDialogueOutcome() != 0)
        {
            dialogueOutcome = dialogueStorage.GetCurrentSlide().GetDialogueOutcome();
            Debug.Log(dialogueOutcome);
            if (button == buttonDialogueOptionTop)
            {
                //savedProgress++;
                //Progress.WriteLine(savedProgress);
                SceneManager.LoadScene("DemoSceneCombat");
            }
        }
    }
Example #2
0
 /// <summary>
 /// Identifies which UI button is pressed and links the button to corresponding
 /// actions.
 /// IF-statements advance the dialogue to the correspongding direction, and
 /// Update the information on the new dialogue slide to UI.
 /// The final IF-statement stores the out come to of the Dialogue to a variable
 /// </summary>
 /// <param name="button"></param>
 private void buttonPressed(Button button)
 {
     dialogueOutcomeManager();
     if (button.CompareTag("DialogueOptionTop"))
     {
         dialogueStorage.DialogueForward("optionTop");
         dialogueStorage.UpdateProgress(savedProgressInt);
         selectPanel();
         updateUISlideInfo();
         Debug.Log(dialogueStorage.GetCurrentSlideIndex());
     }
     else if (button.CompareTag("DialogueOptionHigh"))
     {
         dialogueStorage.DialogueForward("optionHigh");
         dialogueStorage.UpdateProgress(savedProgressInt);
         selectPanel();
         updateUISlideInfo();
         Debug.Log(dialogueStorage.GetCurrentSlideIndex());
     }
     else if (button.CompareTag("DialogueOptionLow"))
     {
         dialogueStorage.DialogueForward("optionLow");
         dialogueStorage.UpdateProgress(savedProgressInt);
         selectPanel();
         updateUISlideInfo();
         Debug.Log(dialogueStorage.GetCurrentSlideIndex());
     }
     else if (button.CompareTag("DialogueOptionBottom"))
     {
         dialogueStorage.DialogueForward("optionBottom");
         dialogueStorage.UpdateProgress(savedProgressInt);
         selectPanel();
         updateUISlideInfo();
         Debug.Log(dialogueStorage.GetCurrentSlideIndex());
     }
 }