mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 21:47:39 +02:00
Fork Lifter: Pea zoom sound lines up (mostly) independent of bpm
This commit is contained in:
@ -9,6 +9,10 @@ namespace RhythmHeavenMania.Util
|
||||
public AudioClip clip;
|
||||
public float pitch = 1;
|
||||
|
||||
// For use with PlayOneShotScheduled
|
||||
public bool scheduled;
|
||||
public double scheduledTime;
|
||||
|
||||
private AudioSource audioSource;
|
||||
|
||||
private int pauseTimes = 0;
|
||||
@ -26,7 +30,7 @@ namespace RhythmHeavenMania.Util
|
||||
audioSource.clip = clip;
|
||||
audioSource.pitch = pitch;
|
||||
|
||||
if (beat == -1)
|
||||
if (beat == -1 && !scheduled)
|
||||
{
|
||||
audioSource.PlayScheduled(Time.time);
|
||||
playInstant = true;
|
||||
@ -39,12 +43,21 @@ namespace RhythmHeavenMania.Util
|
||||
|
||||
startTime = Conductor.instance.songPosition;
|
||||
|
||||
StartCoroutine(NotRelyOnBeatSound());
|
||||
if (!scheduled)
|
||||
StartCoroutine(NotRelyOnBeatSound());
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!playInstant)
|
||||
if (scheduled)
|
||||
{
|
||||
if (AudioSettings.dspTime > scheduledTime)
|
||||
{
|
||||
StartCoroutine(NotRelyOnBeatSound());
|
||||
playIndex++;
|
||||
}
|
||||
}
|
||||
else if (!playInstant)
|
||||
{
|
||||
if (Conductor.instance.songPositionInBeats > beat && playIndex < 1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user