using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; namespace R0bbie.Timeline { /// /// Generic TimelineTrigger which invokes an event, and keeps track if it was previously triggered /// public class TimelineTrigger : MonoBehaviour { // No functional impact - but allow giving this trigger a description so its clearer what it relates to on the component itself [SerializeField] string description; // Provide public subscribable trigger event public UnityEvent onTrigger; // Track whether previously triggered public bool triggered { get; protected set; } /// /// On trigger /// public void Trigger() { triggered = true; onTrigger.Invoke(this); } } }