using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UI_and_Audio
{
    public class UIAudioTrigger : MonoBehaviour, IPointerEnterHandler, IPointerDownHandler
    {
        public enum UIType
        {
            Button,
            Page
        }

        [Header("UI Type")] public UIType uiType;
        
        public void OnPointerEnter(PointerEventData eventData)
        {
            switch (uiType)
            {
                // button has a hover effect
                case UIType.Button:
                    AudioManager.Instance?.PlayHoverSound();
                    break;
                case UIType.Page:
                    break;
                default:
                    break;
            }
        }

        public void OnPointerDown(PointerEventData eventData)
        {
            switch (uiType)
            {
                // button has a hover effect
                case UIType.Button:
                    AudioManager.Instance?.PlayClickSound();
                    break;
                case UIType.Page:
                    AudioManager.Instance?.PlayTurnPageSound();
                    break;
                default:
                    break;
            }
        }
        
        
    }
}
