| | 1 | | using UnityEngine; |
| | 2 | | using UnityEngine.EventSystems; |
| | 3 | | using UnityEngine.UI; |
| | 4 | |
|
| | 5 | | public class ScrollbarHandleAudioHandler : MonoBehaviour, IPointerEnterHandler, IPointerDownHandler |
| | 6 | | { |
| | 7 | | [SerializeField] |
| | 8 | | Selectable selectable; |
| | 9 | |
|
| | 10 | | public void OnPointerEnter(PointerEventData eventData) |
| | 11 | | { |
| 0 | 12 | | if (selectable != null && !Input.GetMouseButton(0)) |
| | 13 | | { |
| 0 | 14 | | if (selectable.interactable) |
| | 15 | | { |
| 0 | 16 | | AudioScriptableObjects.buttonHover.Play(true); |
| | 17 | | } |
| | 18 | | } |
| 0 | 19 | | } |
| | 20 | |
|
| | 21 | | public void OnPointerDown(PointerEventData eventData) |
| | 22 | | { |
| 0 | 23 | | if (selectable != null) |
| | 24 | | { |
| 0 | 25 | | if (selectable.interactable) |
| | 26 | | { |
| 0 | 27 | | AudioScriptableObjects.buttonClick.Play(true); |
| | 28 | | } |
| | 29 | | } |
| 0 | 30 | | } |
| | 31 | | } |