44 lines
1.0 KiB
C#
44 lines
1.0 KiB
C#
using System;
|
|
using TMPro;
|
|
using UnityEngine.EventSystems;
|
|
|
|
namespace Studio.UVC.UI
|
|
{
|
|
/// <summary>
|
|
/// 이미지 버튼
|
|
/// </summary>
|
|
public class UVCImageButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
|
|
{
|
|
private TextMeshProUGUI text_btnName;
|
|
|
|
public Action onClickImageBtn;
|
|
public Action onEnterImageBtn;
|
|
public Action onExitImageBtn;
|
|
|
|
public TextMeshProUGUI Text_btnName
|
|
{
|
|
get
|
|
{
|
|
if (text_btnName == null)
|
|
text_btnName = GetComponentInChildren<TextMeshProUGUI>();
|
|
return text_btnName;
|
|
}
|
|
|
|
}
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
onClickImageBtn?.Invoke();
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
onEnterImageBtn?.Invoke();
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
onExitImageBtn?.Invoke();
|
|
}
|
|
}
|
|
}
|