]> git.lizzy.rs Git - SuperMouseAdventure.git/blob - 2DGame/Assets/Scripts/Dialogue/DialogueTrigger.cs
Dialogue System v0.9.2
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Dialogue / DialogueTrigger.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4
5 public class DialogueTrigger : MonoBehaviour
6 {
7     [SerializeField] GameObject DialogueManager;
8
9     Dialogue dialogue;
10
11     public TextAsset[] stringFromFile;
12
13     void Start()
14     {
15         dialogue = DialogueManager.GetComponent<Dialogue>();
16     }
17
18     private void OnTriggerEnter2D(Collider2D collision)
19     {
20         if(collision.tag == "Player")
21         {
22             GetComponent<BoxCollider2D>().enabled = false;
23             StartCoroutine(dialogue.Type());
24         }
25     }
26 }