Fixed some errors
This commit is contained in:
parent
34819ed791
commit
2ab3c8b8cc
|
@ -230,6 +230,7 @@ namespace RhythmHeavenMania
|
||||||
public void Pause()
|
public void Pause()
|
||||||
{
|
{
|
||||||
Conductor.instance.Pause();
|
Conductor.instance.Pause();
|
||||||
|
KillAllSounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop(float beat)
|
public void Stop(float beat)
|
||||||
|
@ -244,6 +245,8 @@ namespace RhythmHeavenMania
|
||||||
{
|
{
|
||||||
for (int i = 0; i < SoundObjects.Count; i++)
|
for (int i = 0; i < SoundObjects.Count; i++)
|
||||||
Destroy(SoundObjects[i].gameObject);
|
Destroy(SoundObjects[i].gameObject);
|
||||||
|
|
||||||
|
SoundObjects.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -109,6 +109,10 @@ namespace RhythmHeavenMania.Util
|
||||||
|
|
||||||
public static void KillLoop(AudioSource source, float fadeTime)
|
public static void KillLoop(AudioSource source, float fadeTime)
|
||||||
{
|
{
|
||||||
|
// Safeguard against previously-destroyed sounds.
|
||||||
|
if (source == null)
|
||||||
|
return;
|
||||||
|
|
||||||
source.GetComponent<Sound>().KillLoop(fadeTime);
|
source.GetComponent<Sound>().KillLoop(fadeTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue