mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 13:27:41 +02:00
Expose Song Pitch to Minigames (#301)
* expose song pitch to minigames * clean up new additions * make new functions actually set music pitch * fix playback speed slider bug
This commit is contained in:
@ -51,7 +51,7 @@ namespace HeavenStudio.Util
|
||||
else
|
||||
{
|
||||
playInstant = false;
|
||||
scheduledPitch = cnd.musicSource.pitch;
|
||||
scheduledPitch = cnd.SongPitch;
|
||||
startTime = (AudioSettings.dspTime + (cnd.GetSongPosFromBeat(beat) - cnd.songPositionAsDouble)/(double)scheduledPitch);
|
||||
audioSource.PlayScheduled(startTime);
|
||||
}
|
||||
@ -79,9 +79,9 @@ namespace HeavenStudio.Util
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!played && scheduledPitch != cnd.musicSource.pitch)
|
||||
if (!played && scheduledPitch != cnd.SongPitch)
|
||||
{
|
||||
scheduledPitch = cnd.musicSource.pitch;
|
||||
scheduledPitch = cnd.SongPitch;
|
||||
startTime = (AudioSettings.dspTime + (cnd.GetSongPosFromBeat(beat) - cnd.songPositionAsDouble)/(double)scheduledPitch);
|
||||
audioSource.SetScheduledStartTime(startTime);
|
||||
}
|
||||
|
Reference in New Issue
Block a user