Files
Shopping_UnityVR/Assets/02_Scripts/UI/BGMHud.cs

22 lines
487 B
C#

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>();
bgmBox.PlayBGM();
currentBgm = bgmBox;
}
}