private void OnSecondsChanged() { if (SecondsChanged != null) { SecondsChanged.Invoke(milliseconds / MILLISECONDS_IN_SECOND); } }
private void OnSecondsChanged() { if (SecondsChanged != null) { SecondsChanged.Invoke(thousanths / 10); } }
private void OnSecondsChanged() { if (SecondsChanged != null) { //this line is incorrect. Fix it! :) SecondsChanged.Invoke(milliseconds / MILLISECONDS_IN_SECOND); } }
private void OnSecondsChanged() { if (SecondsChanged != null) { //this line is incorrect. Fix it! :) SecondsChanged.Invoke(seconds); } }
private void nudSeconds_ValueChanged(object sender, EventArgs e) { int seconds = Decimal.ToInt32(nudSeconds.Value); TimeSpan ts = new TimeSpan(this.Delay.Hours, this.Delay.Minutes, seconds); this.Delay = ts; SecondsChanged.Invoke(this, new EventArgs()); }
public OfflineTimer(string name, TimeSpan interval) { this.name = name; this.interval = interval; Timer = new CoroutineTimer().WithLoopTime(Convert.ToInt32(interval.TotalSeconds)).WithInfinityLoop(); Timer.AllCompleted += () => AllCompleted?.Invoke(); Timer.TimesUp += TimerOnTimesUp; Timer.SecondsChanged += (i) => SecondsChanged?.Invoke(i); }
void Update(float deltaTime) { if (RemainTime <= 0) { return; } if (IsPaused) { return; } if (IsCompleted) { return; } RemainTime -= deltaTime; RemainTime = Mathf.Max(0, RemainTime); var currentSeconds = Mathf.FloorToInt(RemainTime) + 1; var wasSeconds = Mathf.FloorToInt(lastFrameTime) + 1; if (currentSeconds != wasSeconds) { SecondsChanged?.Invoke(currentSeconds); } if (RemainTime == 0) { SecondsChanged?.Invoke(0); TimesUp?.Invoke(); if (LoopCount > 0) { LoopCount--; } if (LoopCount != 0) { RemainTime = time; } else { Complete(); } } lastFrameTime = RemainTime; }
private void DurationControlNumericUpDownSeconds_ValueChanged(object sender, EventArgs e) { SecondsChanged?.Invoke(this, e); DurationChanged?.Invoke(this, e); }