22 lines
518 B
C#
22 lines
518 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ButtonSoundController : MonoBehaviour {
|
|
[SerializeField] int hoverIndex = 0;
|
|
[SerializeField] int clickIndex = 1;
|
|
|
|
[HideInInspector] SFXLibraryController sfx;
|
|
|
|
public void Start() {
|
|
sfx = GameObject.FindWithTag("SFX").GetComponent<SFXLibraryController>();
|
|
}
|
|
|
|
public void Hover () {
|
|
sfx.PlaySound(hoverIndex);
|
|
}
|
|
public void Click () {
|
|
sfx.PlaySound(clickIndex);
|
|
}
|
|
}
|