]> git.lizzy.rs Git - SuperMouseAdventure.git/blobdiff - 2DGame/Assets/Scripts/Dialogue/DialogueTrigger.cs
dialogue-system v0.9
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Dialogue / DialogueTrigger.cs
index 70a0c56611d1d02ae3a6083f1053960c610d4863..feb4993cb39c3f0e5da4ec33bc6bf306dd1f1210 100644 (file)
@@ -4,12 +4,11 @@ using UnityEngine;
 
 public class DialogueTrigger : MonoBehaviour
 {
-    [SerializeField]
-    GameObject DialogueManager;
+    [SerializeField] GameObject DialogueManager;
 
     Dialogue dialogue;
 
-    public TextAsset dialogueString;
+    public TextAsset[] stringFromFile;
 
     void Start()
     {
@@ -18,12 +17,9 @@ public class DialogueTrigger : MonoBehaviour
 
     private void OnTriggerEnter2D(Collider2D collision)
     {
-        if(collision.gameObject.CompareTag("Player"))
+        if(collision.tag == "Player")
         {
             StartCoroutine(dialogue.Type());
-            collision.gameObject.GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeAll;
-            collision.gameObject.GetComponent<MouseController>().enabled = false;
-            GetComponent<BoxCollider2D>().enabled = false;
         }
     }
 }
\ No newline at end of file