コード例 #1
0
 public void Stop()
 {
     Debug.Log(GameTimers.TIMER + id + " Stoped!");
     OnUpdate?.Invoke(0);
     isComplete = true;
     GameTimers.RemoveTimer(id);
 }
コード例 #2
0
        private void Update()
        {
            _preTime = timeLeft;
            timeLeft = GetTimeLeft();

            if (_preTime != timeLeft)
            {
                OnUpdate?.Invoke(timeLeft);
            }

            if (timeLeft <= 0)
            {
                Debug.Log(GameTimers.TIMER + id + " Completed!");
                isComplete = true;
                GameTimers.RemoveTimer(id);

                OnComplete?.Invoke(this);
            }
        }