@@ -108,6 +108,7 @@ public class consoleOnMono : MonoBehaviour
|
||||
yield return GenerateLegacyNoteVisualOverrides(elements, stats);
|
||||
yield return GenerateLegacyAnimations(elements, stats);
|
||||
yield return RefreshLegacyImport(stats);
|
||||
yield return ApplyLegacyPositionSyncInitialPass();
|
||||
|
||||
LogWindow.Log(
|
||||
$"Legacy tbm import finished. Created {stats.created}, skipped {stats.skipped}, failed {stats.failed}.",
|
||||
@@ -743,6 +744,36 @@ public class consoleOnMono : MonoBehaviour
|
||||
Debug.Log($"[LegacyImport] Refresh complete: {refreshed} elements refreshed, {stats.failed} failures");
|
||||
}
|
||||
|
||||
private IEnumerator ApplyLegacyPositionSyncInitialPass()
|
||||
{
|
||||
float songTime = CoreServices.TimeProvider?.SongTime ?? 0f;
|
||||
int syncCount = 0;
|
||||
|
||||
foreach (GameElement element in legacyIdToElement.Values)
|
||||
{
|
||||
if (element is IHaveTransformSubmodule transformHost)
|
||||
{
|
||||
transformHost.UpdateTransform(false);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (GameElement element in legacyIdToElement.Values)
|
||||
{
|
||||
if (element is not PositionSync sync)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
sync.ScheduledUpdate(UpdatePhase.Animation, songTime);
|
||||
sync.ScheduledUpdate(UpdatePhase.Effect, songTime);
|
||||
syncCount++;
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
Debug.Log($"[LegacyImport] PositionSync initial pass complete: {syncCount} syncs applied at songTime={songTime}");
|
||||
}
|
||||
|
||||
private void TryCreateLegacyElement(JSONNode node, Func<GameElement> create, LegacyImportStats stats)
|
||||
{
|
||||
string legacyId = GetString(node, "id", string.Empty);
|
||||
|
||||
Reference in New Issue
Block a user