/// <summary> /// Intended for children to call to notify the scene of animation-specific events /// a short time after this is called /// </summary> /// <param name="Anim">The animator to fire the events in relation to</param> protected virtual void DelayedFireEvent(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller) { MonoBehaviour monoBehaviour = animator.GetComponent <MonoBehaviour>(); if (monoBehaviour == null) { Debug.LogError("Could not find a monobehaviour on " + animator.name, this); return; } monoBehaviour.DelayedExecution(DelayTimeSeconds, () => FireEvents(animator, stateInfo, layerIndex, controller), UseRealTimeSeconds); }