The SyncTimer allows for easy synchronizing of a timer automatically counting down.
You can easily do actions such as starting, stopping, pausing and resuming the timer. Most methods accessible should be quite self-explanatory.
The SyncTimer also automatically handles reconciliation of the timer, meaning that it will force align all clients to ensure de-syncing doesn't happen. The more frequent, the more precise it will be, but the more data is used. Generally it is very data light, so don't fear for making the number lower if necessary.
Below is an example usage of the SyncTimer being server authorized (default) and having a reconcile interval of 3 (default)
publicTMP_Text timerText;//false = OwnerAuth//3 = Reoncile interval//The reconcile interval deciphers how often it will force align all clientsprivateSyncTimer timer =new();privatevoidAwake() { //onTimerSecondTick is called every 1 secondtimer.onTimerSecondTick+= OnTimerSecondTick;}protectedoverridevoidOnSpawned(bool asServer){ //This starts the timer with 30 seconds countdownif(isOwner)timer.StartTimer(30f);}privatevoidOnTimerSecondTick(){ //You can also get .remaining to get the precise float value //For displaying timers, the remainingInt makes it easytimerText.text=timer.remainingInt.ToString();}privatevoidPauseGameTimer() { //Pauses the timer and will sync the remaining time because it's set to truetimer.PauseTimer(true);}privatevoidResumeGameTimer(){ //Will resume the timer from where it was pausedtimer.ResumeTimer();}