public void AddTimer(GameObject go, string timerName, float delay, TimerManager.UpdateFunc func) { if (!this.timers.ContainsKey(timerName)) { LuaTimerBehaviour luaTimerBehaviour = go.AddComponent <LuaTimerBehaviour>(); luaTimerBehaviour.StartTimer(delay, func); this.timers.Add(timerName, luaTimerBehaviour); } }
public void AddRepeatingTimer(GameObject go, string timerName, float delay, float interval, TimerManager.UpdateFunc func) { Debugger.Log("AddRepeatingTimer: " + timerName); if (!this.timers.ContainsKey(timerName)) { LuaTimerBehaviour luaTimerBehaviour = go.AddComponent <LuaTimerBehaviour>(); luaTimerBehaviour.StartRepeatingTimer(delay, interval, func); this.timers.Add(timerName, luaTimerBehaviour); } }