2026-04-27 중간저장
This commit is contained in:
28
Assets/02_Scripts/UI/BGMBox.cs
Normal file
28
Assets/02_Scripts/UI/BGMBox.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class BGMBox : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private BGMClip _bgmClip;
|
||||
|
||||
[Header("Refs")]
|
||||
[SerializeField] private TMP_Text _bgmNameField;
|
||||
[SerializeField] private GameObject _playSignObj;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_bgmNameField.text = _bgmClip.BGMName;
|
||||
}
|
||||
|
||||
public void PlayBGM()
|
||||
{
|
||||
SoundManager.Instance.PlayBGM(_bgmClip.Clip);
|
||||
_playSignObj.SetActive(true);
|
||||
}
|
||||
|
||||
public void StopBGM()
|
||||
{
|
||||
SoundManager.Instance.StopBGM();
|
||||
_playSignObj.SetActive(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user