usingUnityEngine;
usingSystem.Collections;
usingUnityEngine.EventSystems;
publicclassEventTriggerListener:UnityEngine.EventSystems.EventTrigger{
publicdelegatevoidVoidDelegate(GameObjectgo);
publicVoidDelegateonClick;
publicVoidDelegateonDown;
publicVoidDelegateonEnter;
publicVoidDelegateonExit;
publicVoidDelegateonUp;
publicVoidDelegateonSelect;
publicVoidDelegateonUpdateSelect;
staticpublicEventTriggerListenerGet(GameObjectgo)
{
EventTriggerListenerlistener=go.GetComponent();
if(listener==null)listener=go.AddComponent();
returnlistener;
}
publicoverridevoidOnPointerClick(PointerEventDataeventData)
{
if(onClick!=null)onClick(gameObject);
}
publicoverridevoidOnPointerDown(PointerEventDataeventData){
if(onDown!=null)onDown(gameObject);
}
publicoverridevoidOnPointerEnter(PointerEventDataeventData){
if(onEnter!=null)onEnter(gameObject);
}
publicoverridevoidOnPointerExit(PointerEventDataeventData){
if(onExit!=null)onExit(gameObject);
}
publicoverridevoidOnPointerUp(PointerEventDataeventData){
if(onUp!=null)onUp(gameObject);
}
publicoverridevoidOnSelect(BaseEventDataeventData){
if(onSelect!=null)onSelect(gameObject);
}
publicoverridevoidOnUpdateSelected(BaseEventDataeventData){
if(onUpdateSelect!=null)onUpdateSelect(gameObject);
}
}