Fork Lifter: Zoom sound scheduling takes song speed into account.

This commit is contained in:
Jenny Crowe 2022-02-05 06:22:18 -07:00
parent 39e14e9e07
commit 82e53cbb16

View file

@ -22,7 +22,8 @@ namespace RhythmHeavenMania.Games.ForkLifter
// SCHEDULING zoom sound so it lines up with when it meets the fork. // SCHEDULING zoom sound so it lines up with when it meets the fork.
var currentDspTime = AudioSettings.dspTime; var currentDspTime = AudioSettings.dspTime;
var zoomStartTime = currentDspTime + (double)(Conductor.instance.secPerBeat * 2) - 0.317; var cond = Conductor.instance;
var zoomStartTime = currentDspTime + (double)(cond.secPerBeat * 2 / cond.musicSource.pitch) - 0.317;
Jukebox.PlayOneShotScheduledGame("forkLifter/zoomFast", (double)zoomStartTime); Jukebox.PlayOneShotScheduledGame("forkLifter/zoomFast", (double)zoomStartTime);
GetComponentInChildren<SpriteRenderer>().sprite = ForkLifter.instance.peaSprites[type]; GetComponentInChildren<SpriteRenderer>().sprite = ForkLifter.instance.peaSprites[type];