public override async Task <bool> Run() { if ((!IsRunning || !IgnoreCanRun) && !CanRun()) { IsDone = true; return(false); } IsRunning = true; foreach (var child in Children.SkipWhile(c => Selection != null && c != Selection)) { var pbComp = child as IPBComponent; if (pbComp == null || pbComp.IsDone) { continue; } Selection = child; var coroutine = new Coroutine(async() => await child.Run()); try { while (true) { coroutine.Resume(); if (coroutine.Status == CoroutineStatus.RanToCompletion) { break; } await Coroutine.Yield(); if (!IgnoreCanRun && !CanRun()) { IsDone = true; return(false); } } if ((bool)coroutine.Result) { return(true); } } finally { coroutine.Dispose(); } } if (CanRun()) { if (PulseSecondaryBot) { await PB.ExecuteSecondaryBot(); } Reset(); return(true); } IsDone = true; return(false); }