/// <summary> /// Ticks the frame of the current looper. /// </summary> /// <returns></returns> public bool Tick() { var ctx = new LogicLooperActionContext(this, _frame++, TimeSpan.FromMilliseconds(1000 / TargetFrameRate) /* Fixed Time */, _ctsAction.Token); var completed = new List <LogicLooper.LooperAction>(); lock (_actions) { foreach (var action in _actions) { if (!InvokeAction(ctx, action)) { completed.Add(action); } } foreach (var completedAction in completed) { _actions.Remove(completedAction); } return(_actions.Count != 0); } }
internal LogicLooperCoroutineActionContext(LogicLooperActionContext ctx) { _actionContext = ctx; }