public override void Execute(EventExecutionContext context, CommandExecutionHandle handle) { if (condition.Evaluate(context, onFailed)) { var script = new EventScript(); script.CommandList = ifTrue; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, handle.Complete); } else { var script = new EventScript(); script.CommandList = ifFalse; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, handle.Complete); } }
public override void Execute(EventExecutionContext context, CommandExecutionHandle handle) { if (inheritVariables) { var script = scriptAsset.Script; script.WaitForAllCommands = true; context.InsertInherit(script, handle.Complete); } else { context.Insert(scriptAsset, handle.Complete, null); } }
private void UpdateLoop(EventExecutionContext context, CommandExecutionHandle handle) { if (condition.Evaluate(context)) { var script = new EventScript(); script.CommandList = routine; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, () => UpdateLoop(context, handle)); } else { handle.Complete(); } }
private void UpdateLoop(EventExecutionContext context, CommandExecutionHandle handle) { counter++; if (count.Evaluate(context, out object result)) { if (result is IComparable resultComparable && counter.CompareTo(resultComparable) < 0) { var script = new EventScript(); script.CommandList = routine; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, () => UpdateLoop(context, handle)); return; } } handle.Complete(); }