Beispiel #1
0
 public void StartStateCoroutine(StateCoroutine coroutine)
 {
     if (stateCoroutine != null)
     {
         StopCoroutine(stateCoroutine);
     }
     stateCoroutine = StartCoroutine(coroutine());
 }
Beispiel #2
0
 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;
         }
     }
 }
Beispiel #3
0
 protected void SetAnimationState(StateCoroutine s)
 {
     CurrentAnimationState = new State(s);
 }
Beispiel #4
0
 protected void SetState(StateCoroutine s)
 {
     CurrentState = new State(s);
 }
Beispiel #5
0
 protected static StateReturn NextState(StateCoroutine next)
 {
     return(new StateReturn(next));
 }
Beispiel #6
0
 public State(StateCoroutine coroutine)
 {
     this.coroutine = coroutine;
 }
Beispiel #7
0
 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> >());
 }