BTSDS: Piano notes will now stop properly even if the game switches during them.

This commit is contained in:
Jenny Crowe
2022-03-09 20:50:19 -07:00
parent 5a56ecf261
commit 84c4e8fc9f
3 changed files with 27 additions and 4 deletions

View File

@ -15,6 +15,9 @@ namespace RhythmHeavenMania.Util
public double scheduledTime;
public bool looping;
public float loopEndBeat = -1;
public float fadeTime;
int loopIndex = 0;
private AudioSource audioSource;
@ -73,6 +76,18 @@ namespace RhythmHeavenMania.Util
}
}
}
if (loopIndex < 1)
{
if (looping && loopEndBeat != -1)
{
if (Conductor.instance.songPositionInBeats > loopEndBeat)
{
KillLoop(fadeTime);
loopIndex++;
}
}
}
}
IEnumerator NotRelyOnBeatSound()