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()); }
private IEnumerator Start() { _halfTime = _duration / 2; OnTimerStarted?.Invoke(); yield return(StartCoroutine(WaitAndPrint(1.0f))); OnTimerEnded?.Invoke(); }
private IEnumerator RunTimer() { OnTimerStarted?.Invoke(this); while (timeLeft > 0) { yield return(null); SetTimeLeft(timeLeft - Time.deltaTime); } OnTimerStopped?.Invoke(this); OnTimerFinished?.Invoke(this); }
/// <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); }
private void StartTON() { timer?.Start(); OnTimerStarted?.Invoke(); }