private IEnumerator _behaviour()
        {
            coroutine = _parentBehaviour.StartCoroutine1(Behaviour(), this);
            yield return(coroutine.GetAwaiter());

            _mc.Transition();
        }
 public void OnEnter(IState from = null)
 {
     if (coroutine != null && coroutine.IsSuspended())
     {
         OnLeave();
     }
     coroutine_trans = _parentBehaviour.StartCoroutine1(_behaviour());
 }
 public CoroutineMarkovState(MonoBehaviour parentBehaviour, MarkovChain mc)
 {
     _parentBehaviour = parentBehaviour;
     _mc       = mc;
     coroutine = null;
 }