This commit is contained in:
OliverS 2024-02-04 08:20:55 +01:00
commit ae415cc858
1 changed files with 12 additions and 0 deletions

View File

@ -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