protected virtual void AdvanceToNextState() { CurrentState.OnComplete -= AdvanceToNextState; CurrentState = NextState; if (CurrentState != null) { CurrentState.OnComplete += AdvanceToNextState; CurrentState.Start(nextStateArgs); } NextState = null; nextStateArgs = null; }
protected virtual void SetNextState(SmartRoutine.UpdateBehaviorFunc nextStateFunc, params object[] args) { NextState = new SmartRoutine(nextStateFunc); nextStateArgs = args; }