using UnityEngine; public class AudioManager : MonoBehaviour { private AudioSource backgroundSource; public static AudioManager Instance { get; private set; } private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); backgroundSource = GetComponent(); } else { Destroy(gameObject); } } public void PlayBackgroundMusic(string trackName) { // Logic to play background music } public void StopBackgroundMusic() { backgroundSource.Stop(); } }