mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-22 01:25:12 +00:00
Fixed some errors
This commit is contained in:
parent
dd3bdaf87c
commit
1d564b4910
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue