Beispiel #1
0
    static void Update()
    {
        for (int i = 0; i < m_timers.Count; i++)
        {
            m_timers[i].Update();

            if (m_timers[i].m_isDone)
            {
                TimerEvent e = m_timers[i];

                e.CompleteTimer();

                if (e.m_repeatCount == 0)
                {
                    m_removeList.Add(e);
                }
            }
        }

        for (int i = 0; i < m_removeList.Count; i++)
        {
            m_timers.Remove(m_removeList[i]);
            //HeapObjectPool<TimerEvent>.PutObject(m_removeList[i]);
        }
    }
Beispiel #2
0
    static void Update()
    {
        for (int i = 0; i < m_timers.Count; i++)
        {
            m_timers[i].Update();

            if (m_timers[i].m_isDone)
            {
                TimerEvent e = m_timers[i];

                e.CompleteTimer();
            }
        }

        //移除所有完结的Timer
        m_timers.RemoveAll(item => item.m_repeatCount == 0);
    }
    void Update()
    {
        for (int i = 0; i < m_timers.Count; i++)
        {
            m_timers[i].Update();

            if (m_timers[i].m_isDone)
            {
                TimerEvent e = m_timers[i];

                if (m_timers[i].m_repeatCount == 0)
                {
                    m_timers.Remove(m_timers[i]);
                    i--;
                }

                e.CompleteTimer();
            }
        }
    }
Beispiel #4
0
    static void Update()
    {
        for (int i = 0; i < m_timers.Count; i++)
        {
            TimerEvent e = m_timers[i];
            e.Update();

            if (e.m_isDone)
            {
                e.CompleteTimer();

                if (e.m_isDone)
                {
                    m_timers.Remove(e);
                }
            }
        }

        if (test != null)
        {
            Debug.Log("Test " + test.m_timerName + " " + test.m_currentTimer + " " + m_timers.Contains(test) + " isDone " + test.m_isDone);
        }
    }