Esempio n. 1
0
 public void InvokeTimerStarted()
 {
     System.Windows.Application.Current.Dispatcher.Invoke(delegate()
     {
         OnTimerStarted?.Invoke();
     });
 }
    IEnumerator Start()
    {
        m_HalfTime = m_Duration / 2;
        OnTimerStarted?.Invoke();
        yield return(StartCoroutine(WaitAndPrint(1.0F)));

        OnTimerEnded?.Invoke();
    }
 public void StartTimer()
 {
     _timer     = 0;
     _timerIsOn = true;
     OnTimerStarted?.Invoke(GetGameTime());
     OnNewMonth?.Invoke(GetGameTime());
     OnNewYear?.Invoke(GetGameTime());
     _coroutine = StartCoroutine(NextTime());
 }
Esempio n. 4
0
        private IEnumerator Start()
        {
            _halfTime = _duration / 2;
            OnTimerStarted?.Invoke();

            yield return(StartCoroutine(WaitAndPrint(1.0f)));

            OnTimerEnded?.Invoke();
        }
Esempio n. 5
0
    private IEnumerator RunTimer()
    {
        OnTimerStarted?.Invoke(this);
        while (timeLeft > 0)
        {
            yield return(null);

            SetTimeLeft(timeLeft - Time.deltaTime);
        }
        OnTimerStopped?.Invoke(this);
        OnTimerFinished?.Invoke(this);
    }
Esempio n. 6
0
        /// <summary>
        /// Starts the timer
        /// </summary>
        /// <param name="ResetIfRunning">True to reset the countdown if it's already running</param>
        public override void StartTimer(bool ResetIfRunning = false)
        {
            if (isRunning)
            {
                if (ResetIfRunning)
                {
                    currentInterval = Duration;
                }
                else
                {
                    return;
                }
            }

            currentInterval = Duration;
            intervalCounter = 0f;
            isRunning       = true;
            OnTimerStarted.SafeInvoke();
            OnIntervalElapsed.SafeInvoke(currentInterval);
        }
Esempio n. 7
0
 private void StartTON()
 {
     timer?.Start();
     OnTimerStarted?.Invoke();
 }