From 1880c272131c1919b60d49559c9dc7601412401e Mon Sep 17 00:00:00 2001 From: minenice55 Date: Mon, 8 Apr 2024 21:54:55 -0400 Subject: [PATCH] let's try this resyncing again --- Assets/Scripts/Conductor.cs | 14 ++++++-------- .../Scripts/Games/SneakySpirits/SneakySpirits.cs | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/Conductor.cs b/Assets/Scripts/Conductor.cs index 4083842e4..1ab571ab8 100644 --- a/Assets/Scripts/Conductor.cs +++ b/Assets/Scripts/Conductor.cs @@ -96,9 +96,7 @@ namespace HeavenStudio private float timelineVolume = 1f; private float minigameVolume = 1f; - const bool doPitchResync = false; - - public void SetTimelinePitch(float pitch, bool resync = false) + public void SetTimelinePitch(float pitch) { if (isPaused || deferTimeKeeping) return; if (pitch != 0 && pitch != timelinePitch) @@ -111,17 +109,17 @@ namespace HeavenStudio if (musicSource != null && musicSource.clip != null) { musicSource.pitch = SongPitch; - if (doPitchResync && isPlaying && resync && !deferTimeKeeping) + if (isPlaying && !(isPaused || deferTimeKeeping)) { time = MapTimeToPitchChanges(absTime + absTimeAdjust); songPos = startPos + time; songPosBeat = GetBeatFromSongPos(songPos); - SeekMusicToTime(songPos, firstBeatOffset); + songPositionInBeatsAsDouble = GetSwungBeat(songPosBeat); } } } - public void SetMinigamePitch(float pitch, bool resync = false) + public void SetMinigamePitch(float pitch) { if (isPaused || deferTimeKeeping || !isPlaying) return; if (pitch != 0 && pitch != minigamePitch) @@ -134,12 +132,12 @@ namespace HeavenStudio if (musicSource != null && musicSource.clip != null) { musicSource.pitch = SongPitch; - if (doPitchResync && isPlaying && resync && !deferTimeKeeping) + if (isPlaying && !(isPaused || deferTimeKeeping)) { time = MapTimeToPitchChanges(absTime + absTimeAdjust); songPos = startPos + time; songPosBeat = GetBeatFromSongPos(songPos); - SeekMusicToTime(songPos, firstBeatOffset); + songPositionInBeatsAsDouble = GetSwungBeat(songPosBeat); } } } diff --git a/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs b/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs index c2154d84e..dd1338710 100644 --- a/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs +++ b/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs @@ -102,7 +102,7 @@ namespace HeavenStudio.Games } if (Conductor.instance.isPlaying) { - Conductor.instance.SetMinigamePitch(1f, true); + Conductor.instance.SetMinigamePitch(1f); } }