using System.Collections.Generic;using UnityEngine;using UnityEngine.EventSystems;using UnityEngine.Events; public class EventManager { public static void addEventListener(GameObject go,EventTriggerType type,UnityAction<BaseEventData>callback) { Eve…
应恢弘之约,写了一个对其发布的匿名函数动态绑定到事件的封装,代码如下: type TAnonEvent=class public class function Wrap<T1,T2>(OnEvent:T1):T2; end; { TAnonEvent } class function TAnonEvent.Wrap<T1,T2>(OnEvent: T1):T2; var Addr:Pointer; AMethod:PMethod; begin Addr:=PPointer(@OnE…