37 lines
711 B
C#
37 lines
711 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class AudioEventSounds : MonoBehaviour, IPointerClickHandler, IEventSystemHandler, IPointerEnterHandler
|
|
{
|
|
[SerializeField]
|
|
private bool useOnHover;
|
|
|
|
[SerializeField]
|
|
private bool useOnClick;
|
|
|
|
public static event Action OnUIHeaderOptionHoverGlobal;
|
|
|
|
public static event Action OnUIHeaderOptionClickGlobal;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
if (useOnClick)
|
|
{
|
|
AudioEventSounds.OnUIHeaderOptionClickGlobal?.Invoke();
|
|
}
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
if (useOnHover)
|
|
{
|
|
AudioEventSounds.OnUIHeaderOptionHoverGlobal?.Invoke();
|
|
}
|
|
}
|
|
}
|