コード例 #1
0
        /// <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);
            }
        }
コード例 #2
0
 internal LogicLooperCoroutineActionContext(LogicLooperActionContext ctx)
 {
     _actionContext = ctx;
 }