Unity 事件处理的几种方式
//Unity 事件处理的几种方式
//1 通过编辑器绑定方式
//2:addlistener
//3:实现接口
//4:自定义框架
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Assets.Scripts._1024
{
class EVENTdome : MonoBehaviour, IPointerDownHandler
{
//Unity 事件处理的几种方式
//1 通过编辑器绑定方式
//2:addlistener
//3:实现接口
//4:自定义框架
//1,2 绑定的同一个事件 ,比较隐秘,不建议用1
//光标类
IPointerEnterHandler pointerEnterHandler;
IPointerDownHandler pointerDownHandler;
IPointerExitHandler pointerExitHandler;
IPointerMoveHandler pointerMoveHandler;
IPointerUpHandler pointerUpHandler;
//拖拽类
IBeginDragHandler beginDragHandler;
IDragHandler dragHandler;
IEndDragHandler endDragHandler;
IDropHandler dropHandler;
//点选类(可点选 的空间)
IUpdateSelectedHandler updateSelectedHandler;
ISelectHandler selectHandler;
IDeselectHandler deselectHandler;
//输入类
IScrollHandler scrollHandler;
IMoveHandler moveHandler;
ISubmitHandler submitHandler;
ICancelHandler cancelHandler;
public void OnPointerDown(PointerEventData eventData)
{
}
}
}