using UnityEngine; namespace KirbyAdventures { [RequireComponent(typeof(Collider))] public class StoryTrigger : MonoBehaviour { [TextArea] public string Quote; public float DisplaySeconds = 4.5f; public bool Once = true; bool _shown; void OnTriggerEnter(Collider other) { if (Once && _shown) return; if (other.GetComponent() == null) return; _shown = true; DialogueUI.ShowTemporary(Quote, DisplaySeconds); } void OnTriggerExit(Collider other) { if (other.GetComponent() == null) return; // Optional: hide early when leaving — keep simple, let timer finish } } }