/// <summary> /// 帧更新 /// </summary> public void Update() { while (m_ListenedEvent.IsEmpty() == false) { System.Object objInfo = null; if (m_ListenedEvent.Pop(ref objInfo) == false || objInfo == null) { continue; } CEventInfo info = objInfo as CEventInfo; if (info == null) { continue; } UInt32 uEventId = info.GetEventId(); System.Object objParam = info.GetEventParam(); m_EventInfoPool.GiveBackObject(info); CHandleInfo handleInfo = null; if (m_EventActionList.QuickFind(uEventId, ref handleInfo) == false || handleInfo == null) { continue; } bool bTriggerRet = handleInfo.TriggerHandle(objParam); if (bTriggerRet == false) { BTDebug.Warning(string.Format("Trigger Event:{0} With Param:{2} Failed", uEventId, objParam), "ACTION"); } } }
/// <summary> /// 帧更新 /// </summary> public void Update() { Int32 nSize = m_TimerList.Count; for (Int32 i = nSize - 1; i >= 0; --i) { CTimer timer = m_TimerList[i]; if (timer == null) { m_TimerList.RemoveAt(i); continue; } timer.TickUpdate(); // 如果已经完成,释放 if (timer.IsTimeUp()) { m_TimerList.RemoveAt(i); } m_TimerPool.GiveBackObject(timer); } }