forked from akanyan/mu3-mods
feat!: rename and reorganize
This commit is contained in:
29
Fixes/FrameRate/MU3.Sys/patch_Time.cs
Normal file
29
Fixes/FrameRate/MU3.Sys/patch_Time.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using MU3.Util;
|
||||
|
||||
namespace MU3.Sys;
|
||||
|
||||
class patch_Time: Time {
|
||||
private static bool _init;
|
||||
private static float _deltaTime;
|
||||
private static float _adjustAccumlation;
|
||||
private static float _realtimeSinceStartup;
|
||||
private static bool _altMode;
|
||||
|
||||
public extern static void orig_update();
|
||||
public static new void update() {
|
||||
if(!_init) {
|
||||
_deltaTime = UnityEngine.Time.deltaTime;
|
||||
_adjustAccumlation = 0f;
|
||||
_realtimeSinceStartup = UnityEngine.Time.realtimeSinceStartup;
|
||||
var cfg = (patch_Config)Singleton<Sys.System>.instance.config;
|
||||
_altMode = cfg.isVsync || (cfg.framerate != 60);
|
||||
_init = true;
|
||||
}
|
||||
if(_altMode) {
|
||||
_deltaTime = UnityEngine.Time.deltaTime;
|
||||
_realtimeSinceStartup = UnityEngine.Time.realtimeSinceStartup;
|
||||
} else {
|
||||
orig_update();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user