18 lines
483 B
C#
18 lines
483 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
[RequireComponent(typeof(Button))]
|
|
public class GeneralUIButton : MonoBehaviour
|
|
{
|
|
void Start()
|
|
{
|
|
Button button = GetComponent<Button>();
|
|
AudioManager audioManager = FindObjectOfType<AudioManager>();
|
|
|
|
if (audioManager != null)
|
|
{
|
|
// Otomatis menambahkan fungsi PlayBubbleSound saat tombol diklik
|
|
button.onClick.AddListener(() => audioManager.PlayBubbleSound());
|
|
}
|
|
}
|
|
} |