【Unity】EventTrigger で押下処理
var currentTrigger = nextTriggerObject.AddComponent<EventTrigger>();
currentTrigger.triggers = new List<EventTrigger.Entry>();
// Press イベント作成。
{
EventTrigger.Entry pointerDown = new EventTrigger.Entry();
pointerDown.eventID = EventTriggerType.PointerDown;
pointerDown.callback.AddListener((x) =>
{
// 処理書く。
});
// 登録。
currentTrigger.triggers.Add(pointerDown);
}