Пример #1
0
    public void FixedUpdate()
    {
        List <string> keys = new List <string>(this.timeVoDict.Keys);

        for (int i = 0; i < this.timeVoDict.Count; ++i)
        {
            string  key = keys[i];
            TimerVo tVo = this.timeVoDict[key];
            if (!tVo.isIncrement)
            {
                tVo.leftSecond -= Time.deltaTime;
                if (tVo.leftSecond <= 0)
                {
                    this.callTimerVoCallBackHandler(tVo);
                    this.timeVoDict.Remove(key);
                }
            }
            else
            {
                tVo.leftSecond += Time.deltaTime;
                if (tVo.leftSecond >= tVo.endSecond)
                {
                    this.callTimerVoCallBackHandler(tVo);
                    this.timeVoDict.Remove(key);
                }
            }
        }
    }