35 lines
715 B
C#
35 lines
715 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class CategoriesButtonHover : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerClickHandler
|
|
{
|
|
private Animator anim;
|
|
|
|
public static event Action OnChangeQuestCategoryGlobal;
|
|
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
CategoriesButtonHover.OnChangeQuestCategoryGlobal?.Invoke();
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
anim.SetBool("hovered", value: true);
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
anim.SetBool("hovered", value: false);
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
anim = GetComponent<Animator>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
}
|
|
}
|