📜  通过代码统一触发事件 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:18.704000             🧑  作者: Mango

代码示例1
EventTrigger trigger = GetComponentInParent();
 EventTrigger.Entry entry = new EventTrigger.Entry();
 entry.eventID = EventTriggerType.PointerClick;
 entry.callback.AddListener( (eventData) => { Foo(); } );
 trigger.triggers.Add(entry);