private IEnumerator ChangeState(StateControllerBase state) { if (CurrentState != null) { yield return(CurrentState.ExitState()); } CurrentState = state; _changeStateRoutine = null; yield return(state.EnterState()); state.StartProcessing(); yield return(null); }
public void ActiveState(StateControllerBase state) { _changeStateRoutine = ChangeState(state); StartCoroutine(_changeStateRoutine); }