private static IEnumerator DoStateThenGoTo(StateMachine stateMachine, CoroutineRef coroutine, TimelineStateRef goToState) { yield return(stateMachine.StartCoroutine(coroutine.RunCoroutine())); stateMachine.GoToState(TimelineStateMachine.Run(stateMachine, goToState)); yield break; }