25 lines
934 B
C#
25 lines
934 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class InitializeCellPointer : MonoBehaviour, IPointerDownHandler, IPointerEnterHandler, IPointerUpHandler
|
|
{
|
|
private InitializePopupCellButton cell;
|
|
private System.Action<InitializePopupCellButton> onDown;
|
|
private System.Action<InitializePopupCellButton> onEnter;
|
|
private System.Action onUp;
|
|
|
|
public void Bind(InitializePopupCellButton cell,
|
|
System.Action<InitializePopupCellButton> onDown,
|
|
System.Action<InitializePopupCellButton> onEnter,
|
|
System.Action onUp)
|
|
{
|
|
this.cell = cell;
|
|
this.onDown = onDown;
|
|
this.onEnter = onEnter;
|
|
this.onUp = onUp;
|
|
}
|
|
|
|
public void OnPointerDown(PointerEventData eventData) => onDown?.Invoke(cell);
|
|
public void OnPointerEnter(PointerEventData eventData) => onEnter?.Invoke(cell);
|
|
public void OnPointerUp(PointerEventData eventData) => onUp?.Invoke();
|
|
} |