Added click SFX (and a couple of other SFX to the project)
This commit is contained in:
@@ -8,6 +8,9 @@ public class MyButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandle
|
||||
[SerializeField]
|
||||
private UnityEvent _onClick;
|
||||
|
||||
[SerializeField]
|
||||
private AudioSource _clickSound;
|
||||
|
||||
// references
|
||||
[SerializeField]
|
||||
private OutlineFx.OutlineFx _outlineFx;
|
||||
@@ -39,7 +42,11 @@ public class MyButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandle
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
if (isActive)
|
||||
{
|
||||
_onClick.Invoke();
|
||||
_clickSound?.Play();
|
||||
}
|
||||
|
||||
}
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user