public override void RunRoutine() { if (isSuccess()) { Reset(); return; } currentRoutine.RunRoutine(); if (currentRoutine.isSuccess()) { if (ActiveRoutine + 1 >= AllRoutines.Count) { Success(); routines = currentRoutine.GetCurrentState(); } else { ActiveRoutine++; currentRoutine = AllRoutines[ActiveRoutine]; currentRoutine.Start(); } } if (currentRoutine.isFailed()) { Failed(); Reset(); return; } }
public override void RunRoutine() { if (CurrentRoutine.isFailed()) { Failed(); Reset(); return; } else if (CurrentRoutine.isSuccess()) { if (RepeatTimes == 0) { Success(); Reset(); return; } if (RepeatTimes > 0 || RepeatTimes <= -1) { RepeatTimes--; CurrentRoutine.Reset(); CurrentRoutine.Start(); } } if (CurrentRoutine.isRunning()) { CurrentRoutine.RunRoutine(); } }