예제 #1
0
    public void StartTimer(float time, Listener onEndOfCountDown, int repeatNum = 1, Listener <float> onUpdate = null, string timerName = "nil")
    {
        Timer timer = TimerPool.Get();

        timer.OnEndOfCountDown = onEndOfCountDown;
        timer.OnUpdate         = onUpdate;
        timer.suplusRepeatNum  = repeatNum;

        if (!timerName.Equals("nil"))
        {
            timer.Name = timerName;
            TimerDic.Add(timerName, timer);
        }

        TimerList.Add(timer);
        LogMgr.I("TimerMgr", "StartTimer", "启动计时器 time:" + time + " name:" + name + " repeatNum:" + repeatNum, BeShowLog);

        timer.Start(time);
    }