public void StartStateCoroutine(StateCoroutine coroutine) { if (stateCoroutine != null) { StopCoroutine(stateCoroutine); } stateCoroutine = StartCoroutine(coroutine()); }
public void Step(long now) { if (IsRunning && nextRun <= now) { IsRunning = coroutine.MoveNext(); StateReturn sr = coroutine.Current; nextRun = now + (sr?.NextRun ?? 0); if (sr?.NextState != null) { coroutine = sr.NextState; IsRunning = true; } } }
protected void SetAnimationState(StateCoroutine s) { CurrentAnimationState = new State(s); }
protected void SetState(StateCoroutine s) { CurrentState = new State(s); }
protected static StateReturn NextState(StateCoroutine next) { return(new StateReturn(next)); }
public State(StateCoroutine coroutine) { this.coroutine = coroutine; }
public StateReturn(StateCoroutine i) { NextState = i; }
public override void Dispose() { _Subroutine.Dispose(); _Subroutine = null; }
public BehaviourCoroutine(IEnumerable <BehaviourState> behaviourSource) { _Subroutine = new StateCoroutine <BehaviourValue>(behaviourSource.Cast <Instruction <BehaviourValue> >()); }