Added click SFX (and a couple of other SFX to the project)

This commit is contained in:
2025-01-10 22:04:57 +01:00
parent 42a859f295
commit 335f496bde
77 changed files with 843 additions and 0 deletions
+7
View File
@@ -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)
{