Open wazazhang opened 2 months ago
以下是改进的代码 就这水平就别出来丢人了
private readonly List<Event> m_EventsFuckJiangYin = new List<Event>(); /// <summary> /// 事件池轮询。 /// </summary> /// <param name="elapseSeconds">逻辑流逝时间,以秒为单位。</param> /// <param name="realElapseSeconds">真实流逝时间,以秒为单位。</param> public void Update(float elapseSeconds, float realElapseSeconds) { lock (m_Events) { m_EventsFuckJiangYin.AddRange(m_Events); m_Events.Clear(); } try { for (int i = 0; i < m_EventsFuckJiangYin.Count; i++) { Event eventNode = m_EventsFuckJiangYin[i]; HandleEvent(eventNode.Sender, eventNode.EventArgs); ReferencePool.Release(eventNode); } } finally { m_EventsFuckJiangYin.Clear(); } }
以下是改进的代码 就这水平就别出来丢人了