Added stop all Audio
This commit is contained in:
parent
d75a0c74a6
commit
3d1f783f19
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using static Unity.VisualScripting.Member;
|
||||
|
||||
|
||||
public class AudioManager : MonoBehaviour
|
||||
|
@ -93,6 +94,17 @@ public class AudioManager : MonoBehaviour
|
|||
yield return new WaitForSecondsRealtime(0.05f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void StopAllAudio()
|
||||
{
|
||||
foreach (SoundSource item in AliveSources)
|
||||
{
|
||||
item.source.Stop();
|
||||
Destroy(item.source.gameObject);
|
||||
}
|
||||
|
||||
AliveSources.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public class SoundSource
|
||||
|
|
Loading…
Reference in New Issue