]> git.lizzy.rs Git - SuperMouseAdventure.git/commitdiff
Dialogue System v0.9.2
authorKG0104 <konstantin.gerlach@kabelmail.de>
Fri, 29 Oct 2021 15:33:03 +0000 (17:33 +0200)
committerKG0104 <konstantin.gerlach@kabelmail.de>
Fri, 29 Oct 2021 15:33:03 +0000 (17:33 +0200)
2DGame/Assets/Scripts/Dialogue/Dialogue.cs

index 3175a89602a603163de2cf50269c263731addd9e..c49228802e2d4bea3d26fc496328b3f4b9bb8331 100644 (file)
@@ -62,51 +62,20 @@ public class Dialogue : MonoBehaviour
 
     public void NextSentence()
     {
-        /*FindObjectOfType<AudioManager>().Play("click");
-        continueButton.SetActive(false);
-
-        if (index < sentences.Length - 1)
-        {
-            index++;
-            dialogueText.text = "";
-            StartCoroutine(Type());
-            speechBubble.NextSpeaker();
+        if(sffIndex < (dialogueTriggerer[dtIndex].stringFromFile.Length - 1)) {
+                    sffIndex++;
         }
-        else
+        else if (sffIndex == (dialogueTriggerer[dtIndex].stringFromFile.Length - 1))
         {
-            dialogueText.text = "";
-            dialogueBox.SetActive(false);
-            SpeechBubble.SetActive(false);
-            mouse.GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeRotation;
-            mouse.GetComponent<MouseController>().enabled = true;
-        }*/
-        if(index < dialogueTriggerer[dtIndex].stringFromFile.Length) {
-                    index += 1;
+            sffIndex = 0;
+            dtIndex++;
         }
+
         StartCoroutine(Type());
     }
 
     public void Skip()
     {
-        /*StopCoroutine(Type());
-        FindObjectOfType<AudioManager>().Play("click");
-        skipButton.SetActive(false);
-
-        if (index < sentences.Length - 1)
-        {
-            index++;
-            dialogueText.text = "";
-            dialogueText.text = sentences[index];
-            speechBubble.NextSpeaker();
-        }
-        else
-        {
-            dialogueText.text = "";
-            dialogueBox.SetActive(false);
-            SpeechBubble.SetActive(false);
-            mouse.GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeRotation;
-            mouse.GetComponent<MouseController>().enabled = true;
-        }*/
-        dialogueText.text = dialogueTriggerer[index].stringFromFile[index].text;
+        dialogueText.text = dialogueTriggerer[dtIndex].stringFromFile[sffIndex].text;
     }
 }
\ No newline at end of file