diff --git a/Assets/Scripts/Managers/AudioManager/AudioManager.cs b/Assets/Scripts/Managers/AudioManager/AudioManager.cs index b50dae8..32d0311 100644 --- a/Assets/Scripts/Managers/AudioManager/AudioManager.cs +++ b/Assets/Scripts/Managers/AudioManager/AudioManager.cs @@ -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