using System.Collections.Generic; using UnityEngine; public class BGMHud : MonoBehaviour { [SerializeField] private GameObject _contentRoot; [SerializeField] private GameObject _contentPrefab; private BGMBox currentBgm; public void PlayPickBGM(GameObject buttonObj) { if(currentBgm != null) currentBgm.StopBGM(); BGMBox bgmBox = buttonObj.GetComponentInParent(); bgmBox.PlayBGM(); currentBgm = bgmBox; } }