revival/game/Assets/Scripts/Dialogue/ScriptedDialogueTrigger.cs

24 lines
552 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
public class ScriptedDialogueTrigger : MonoBehaviour
{
[SerializeField] private DialogueSystem _dialogue;
[SerializeField] private string _key;
[SerializeField] private bool _log;
private void OnTriggerEnter(Collider other)
{
if (_log)
{
Debug.Log($"{other} triggered dialogue {_key}");
}
_dialogue.PlayLine(_key);
}
}