EventTrigger.TriggerEvent triggerEvent = new EventTrigger.TriggerEvent();
target.GetComponent<EventTrigger>().triggers.Add(new EventTrigger.Entry() {
eventID = EventTriggerType.Drag,
callback = triggerEvent,
});
target.GetComponent<EventTrigger>().triggers.Add(new EventTrigger.Entry()
{
eventID = EventTriggerType.PointerClick,
callback = triggerEvent,
});
triggerEvent.AddListener(OnEventCallBack);
//OnClickListener();
public void OnEventCallBack(BaseEventData eventData) {
OnClickListener();
}
网友评论