|
s_Timers[name] = DateTime.Now.Ticks; |
the TimeUtility class is based on DateTime, which means it breaks when pausing the play mode in the editor (timers should not proceed while paused).
Relying on Time.time OR Time.unscaledTime would pause if the game is paused in the editor (or even paused via timeScale in game, for Time.time)
Also the class is missing a "RuntimeInitializeOnLoad" to clear the static dictionary, which means timers would survive the playmode if the faster-playmode-options are used (https://blog.unity.com/technology/enter-play-mode-faster-in-unity-2019-3)
com.stansassets.foundation/Runtime/Utilities/TimeUtility.cs
Line 20 in b333205
the TimeUtility class is based on DateTime, which means it breaks when pausing the play mode in the editor (timers should not proceed while paused).
Relying on Time.time OR Time.unscaledTime would pause if the game is paused in the editor (or even paused via timeScale in game, for Time.time)
Also the class is missing a "RuntimeInitializeOnLoad" to clear the static dictionary, which means timers would survive the playmode if the faster-playmode-options are used (https://blog.unity.com/technology/enter-play-mode-faster-in-unity-2019-3)