public static void Update(float totalTime) { TimerMan pTimerMan = TimerMan.PrivGetInstance(); Debug.Assert(pTimerMan != null); pTimerMan.mCurrTime = totalTime; TimerEvent pEvent = (TimerEvent)pTimerMan.BaseGetActive(); TimerEvent pNextEvent = null; while (pEvent != null && (pTimerMan.mCurrTime >= pEvent.GetTriggerTime())) { pNextEvent = (TimerEvent)pEvent.pNext; if (pTimerMan.mCurrTime >= pEvent.GetTriggerTime()) { pEvent.Process(); pTimerMan.BaseRemove(pEvent); } pEvent = pNextEvent; } }
private static TimerEvent PrivLocateNode(float triggerTime) { TimerMan pTimerMan = TimerMan.PrivGetInstance(); Debug.Assert(pTimerMan != null); TimerEvent pNode = (TimerEvent)pTimerMan.BaseGetActive(); TimerEvent pPrevNode = null; while (pNode != null && pNode.GetTriggerTime() < triggerTime) { pPrevNode = pNode; pNode = (TimerEvent)pNode.pNext; } return(pPrevNode); }