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; public void CheckPointPass(Collider collider) { OnCheckpointPass?.Invoke(); } [ContextMenu("Debug Checkpoint")] public void DebugPass() { CheckPointPass(null); } private void Awake() { _splineTrigger = GetComponentInChildren(); } private void OnEnable() { _splineTrigger.OnTriggerEvent.AddListener(CheckPointPass); } private void OnDisable() { _splineTrigger.OnTriggerEvent.RemoveListener(CheckPointPass); } }