public void StartWaitTimer() { WaitTimerStarted?.Invoke(this, Delay); WaitTimer = new System.Timers.Timer(1000); WaitCount = Delay; WaitTimer.Elapsed += WaitTimer_Elapsed; WaitTimerUpdate?.Invoke(this, WaitCount); WaitTimer.Start(); }
private void WaitTimer_Elapsed(object sender, ElapsedEventArgs e) { WaitCount--; if (WaitCount <= 0) { WaitCount = 0; WaitTimer.Stop(); WaitTimerDone?.Invoke(this, new EventArgs()); } WaitTimerUpdate?.Invoke(this, WaitCount); }
private void ScriptFSM_WaitTimerUpdate(object sender, int e) { WaitTimerUpdate?.Invoke(sender, e); }