public static IEnumerator Out(AnimationTransitEntry e, Action afterAction = null)
        {
            yield return(animate(e.Animator, e.OutState));

            e.Object.SetActive(false);
            afterAction?.Invoke();
        }
        public static IEnumerator In(AnimationTransitEntry e, Action afterAction = null)
        {
            e.Object.SetActive(true);
            yield return(animate(e.Animator, e.InState));

            afterAction?.Invoke();
        }
 public static IEnumerator Transition(AnimationTransitEntry from, AnimationTransitEntry to, Action afterAction = null)
 {
     if (from != null)
     {
         yield return(Out(from));
     }
     if (to != null)
     {
         yield return(In(to));
     }
     afterAction?.Invoke();
 }