using UnityEngine; using UnityEngine.UI; namespace BulletHellTemplate { /// /// Plays audio when a button or toggle is clicked. Uses the AudioManager to play the audio globally. /// public class ButtonAudio : MonoBehaviour { [Tooltip("The audio clip that plays when the button is clicked.")] public AudioClip buttonClickAudio; [Tooltip("The tag used for categorizing the audio (Master, VFX, Ambient, Custom).")] public string audioTag = "master"; private Button button; private Toggle toggle; private void Awake() { // Get the button or toggle component button = GetComponent