using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using UnityEngine.Playables; public class CheckPoint : MonoBehaviour { public UnityEvent OnCheckpointPass; private SplineTrigger _splineTrigger; [ContextMenu("Debug Checkpoint")] public void CheckPointPass(Collider collider) { OnCheckpointPass?.Invoke(); } private void Awake() { _splineTrigger = GetComponentInChildren(); } private void OnEnable() { _splineTrigger.OnTriggerEvent.AddListener(CheckPointPass); } private void OnDisable() { _splineTrigger.OnTriggerEvent.RemoveListener(CheckPointPass); } }