Fixed some errors

This commit is contained in:
Jenny Crowe 2022-03-07 02:41:07 -07:00
parent dd3bdaf87c
commit 1d564b4910
2 changed files with 7 additions and 0 deletions

View File

@ -230,6 +230,7 @@ namespace RhythmHeavenMania
public void Pause()
{
Conductor.instance.Pause();
KillAllSounds();
}
public void Stop(float beat)
@ -244,6 +245,8 @@ namespace RhythmHeavenMania
{
for (int i = 0; i < SoundObjects.Count; i++)
Destroy(SoundObjects[i].gameObject);
SoundObjects.Clear();
}
#endregion

View File

@ -109,6 +109,10 @@ namespace RhythmHeavenMania.Util
public static void KillLoop(AudioSource source, float fadeTime)
{
// Safeguard against previously-destroyed sounds.
if (source == null)
return;
source.GetComponent<Sound>().KillLoop(fadeTime);
}
}