ItemDragHandler

 avatar
user_3183455
csharp
8 days ago
794 B
1
Indexable
Never
using UnityEngine;
using UnityEngine.EventSystems;
 
namespace CuongMono.Item
{
    public abstract class ItemDragHandler : MonoBehaviour,
    IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
    {
        [Header("Item Drag Handler")]
        [SerializeField] protected ItemSlotUI itemSlotUI;
        [SerializeField] protected CursorHolderBehaviour cursorHolder = null;
 
        public int SlotIndex { get => transform.parent.GetSiblingIndex(); }
        public abstract void OnPointerClick(PointerEventData eventData);
 
        public void OnPointerEnter(PointerEventData eventData)
        {
            //Popup tooltip
        }
 
        public void OnPointerExit(PointerEventData eventData)
        {
            //Hide tooltip
        }
    }
}
Leave a Comment