public IEnumerator Execute(ICodeblockExecutionContext context) { int count = LoopCount.Evaluate(context); if (count > 0) { for (int i = 0; i < count; i++) { IEnumerator coroutine = Children.ExecuteCodeblocks(context); context.LoopModule.RegisterLoopCoroutine(coroutine); yield return(context.Source.StartCoroutine(coroutine)); // Attempt to complete the most top-level coroutine. If this fails, the method was // cancelled, the LastCancelReason should be used for further handling. if (!context.LoopModule.CompleteCoroutine(coroutine)) { var reason = context.LoopModule.LastCancelReason; if (reason == LoopCancelReason.Break) { break; } if (reason == LoopCancelReason.Continue) { continue; } } yield return(new UnityEngine.WaitForSeconds(context.Delay)); } } yield return(null); }
public bool Search(string str) { if (ActionName.Contains(str) || LoopCount.ToString().Contains(str) || Interval.ToString().Contains(str) || PlayTime.ToString().Contains(str)) { return(true); } else { return(false); } }
protected override string GetCommandGroupHeader(ExportSettings exportSettings) => $"L,{((int)StartTime).ToString(exportSettings.NumberFormat)},{LoopCount.ToString(exportSettings.NumberFormat)}";
public bool BuildDialString() { if (string.IsNullOrEmpty(DialPrefix)) { return(false); } if (ActionType == PA_ACTION_TYPE.PA_ACT_NONE) { return(false); } if (Sections == null) { return(false); } string dialstring = DialPrefix; switch (ActionType) { case PA_ACTION_TYPE.PA_ACT_MANUAL: dialstring += "11"; break; case PA_ACTION_TYPE.PA_ACT_MUSIC: dialstring += "2"; break; case PA_ACTION_TYPE.PA_ACT_AUTO: dialstring += "3"; break; case PA_ACTION_TYPE.PA_ACT_EAVESDROP: dialstring += "4"; break; default: return(false); } dialstring += LoopCount.ToString(); dialstring += GroupId.ToString(); string section = null, zones = null; BuildSectionString(ref section, ref zones); if (section == null || zones == null) { return(false); } SectionsId = section; Zones = zones; dialstring += section; dialstring += zones; DialString = dialstring; return(true); }