Implement force tick and sync time for input proxy.

This commit is contained in:
2022-11-12 16:59:39 +08:00
parent 604398cae2
commit a47faf0049
2 changed files with 23 additions and 12 deletions

View File

@@ -115,16 +115,9 @@ namespace Cryville.Crtr {
? 1f / Application.targetFrameRate
: Time.deltaTime;
firstFrame = false;
inputProxy.ForceTick();
cbus.ForwardByTime(dt);
bbus.ForwardByTime(dt);
UnityEngine.Profiling.Profiler.BeginSample("ChartPlayer.FeedJudge");
/*judge.StartFrame();
Game.InputManager.EnumerateEvents(ev => {
// Logger.Log("main", 0, "Input", ev.ToString());
judge.Feed(ev);
});
judge.EndFrame();*/
UnityEngine.Profiling.Profiler.EndSample();
UnityEngine.Profiling.Profiler.BeginSample("ChartPlayer.Forward");
UnityEngine.Profiling.Profiler.BeginSample("EventBus.Copy");
bbus.CopyTo(2, tbus);
@@ -410,6 +403,7 @@ namespace Cryville.Crtr {
Game.AudioSequencer.Playing = true;
Thread.Sleep((int)(Game.AudioClient.BufferPosition - Game.AudioClient.Position));
// TODO SyncTime(cbus.Time);
inputProxy.SyncTime(cbus.Time);
started = true;
}
catch (Exception ex) {