同步
This commit is contained in:
@@ -44,6 +44,8 @@ namespace Ichni
|
||||
public List<IHaveTransformSubmodule> activeTransformSubmodules = new List<IHaveTransformSubmodule>();
|
||||
public List<IHaveColorSubmodule> activeColorSubmodules = new List<IHaveColorSubmodule>();
|
||||
public List<IHaveDirtyMarkSubmodule> activeDirtyMarkSubmodules = new List<IHaveDirtyMarkSubmodule>();
|
||||
|
||||
public ElementUpdateScheduler updateScheduler;
|
||||
|
||||
[Title("UI")]
|
||||
public Canvas judgeHintCanvas;
|
||||
@@ -64,6 +66,8 @@ namespace Ichni
|
||||
CoreServices.TimeProvider = this;
|
||||
timeDurations = new List<TimeDurationSubmodule>();
|
||||
playingRecorder = new PlayingRecorder();
|
||||
updateScheduler = new ElementUpdateScheduler();
|
||||
CoreServices.UpdateScheduler = updateScheduler;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
@@ -74,43 +78,12 @@ namespace Ichni
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!songPlayer.isUpdating) return;
|
||||
|
||||
foreach (var timeDuration in timeDurations)
|
||||
{
|
||||
timeDuration?.DetectAndSwitchActiveState(SongTime);
|
||||
}
|
||||
|
||||
animationManager.ManualUpdate(SongTime);
|
||||
trackManager.ManualUpdate(SongTime);
|
||||
noteManager.ManualUpdate(SongTime);
|
||||
updateScheduler.TickEarly(SongTime);
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (songPlayer.isUpdating)
|
||||
{
|
||||
trackManager.ManualLateUpdate(SongTime);
|
||||
noteManager.ManualLateUpdate(SongTime);
|
||||
|
||||
for (int i = 0; i < activeColorSubmodules.Count; i++)
|
||||
{
|
||||
activeColorSubmodules[i].UpdateColor(true);
|
||||
}
|
||||
|
||||
for (int i = 0; i < activeTransformSubmodules.Count; i++)
|
||||
{
|
||||
activeTransformSubmodules[i].UpdateTransform(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (songPlayer.isStarting || songPlayer.isPlaying)
|
||||
{
|
||||
for (int i = 0; i < activeDirtyMarkSubmodules.Count; i++)
|
||||
{
|
||||
activeDirtyMarkSubmodules[i]?.dirtyMarkSubmodule?.ExecuteDeferredRefresh();
|
||||
}
|
||||
}
|
||||
updateScheduler.TickLate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user