Code: Select all
using System.Collections;
using System.Collections.Generic;
using PixelCrushers.DialogueSystem;
using UnityEngine;
public class DialoguePosTrigger : MonoBehaviour
{
public bool inDialogue;
public SplineMoving splineMoving;
public DialogueSystemTrigger dialogueTrigger;
// Start is called before the first frame update
void Start()
{
dialogueTrigger = GetComponent<DialogueSystemTrigger>();
splineMoving = GameObject.Find("PlayerRotation").GetComponentInChildren<SplineMoving>();
inDialogue = false;
}
// Update is called once per frame
void Update()
{
inDialogue = splineMoving.inDialogue;
if (splineMoving.inDialogue)
{
dialogueTrigger.gameObject.SetActive(true);
}
}
}