Esempio n. 1
0
 private void Update()
 {
     if (timer != null)
     {
         timer.Update(Time.deltaTime, Time.unscaledDeltaTime);
     }
 }
Esempio n. 2
0
        /// <summary>
        ///     主循环
        /// </summary>
        public void Run()
        {
            _watch.Start();

            while (!_quit)
            {
                // 1、 定时器调度
                TimerMgr.Update(ElapsedMilliseconds);

                // 2、 协程调度
                CoroutineScheduler.Ins.Update();

                // 3、 job调度
                var enterTime = ElapsedMilliseconds;
                do
                {
                    try {
                        IJob item;
                        if (_workingQueue.TryTake(out item, Period))
                        {
                            item.Do();
                        }
                        else
                        {
                            break;
                        }
                    }
                    catch (Exception ex) {
                        Logger.Ins.Fatal("{0} : {1}", ex.Message, ex.StackTrace);
                    }
                } while (ElapsedMilliseconds - enterTime < Period);
            }

            IJob leftItem;

            while (_workingQueue.TryTake(out leftItem, Period * 10))
            {
                leftItem.Do();
            }

            _watch.Stop();
        }
Esempio n. 3
0
 void Update()
 {
     m_timerMgr.Update();
 }