41 lines
582 B
C#
41 lines
582 B
C#
using System.Collections.Generic;
|
|
namespace G
|
|
{
|
|
public class TimerManager
|
|
{
|
|
public int m_count;
|
|
|
|
public List<Timer> m_aryTimers;
|
|
|
|
public TimerManager()
|
|
{
|
|
m_aryTimers = new List<Timer>();
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
for (int i = 0; i < m_aryTimers.Count; i++)
|
|
{
|
|
if (!m_aryTimers[i].Update())
|
|
{
|
|
if (m_aryTimers.Count > 0)
|
|
{
|
|
m_aryTimers.RemoveRange(i, 1);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void Add(Timer timer)
|
|
{
|
|
m_aryTimers.Add(timer);
|
|
}
|
|
|
|
public void Remove(Timer timer)
|
|
{
|
|
m_aryTimers.Remove(timer);
|
|
}
|
|
}
|
|
}
|