private void Update() { if (timer != null) { timer.Update(Time.deltaTime, Time.unscaledDeltaTime); } }
/// <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(); }
void Update() { m_timerMgr.Update(); }