public void SubscribeToEvent(Object sender, StringHash eventType, Action <StringHash, VariantMap> function) { Urho3D_Object_SubscribeToEvent(__ToPInvoke(this), GCHandle.ToIntPtr(GCHandle.Alloc(function)), eventType.Hash, (gcHandle, type, args) => { var callback = (Action <StringHash, VariantMap>)GCHandle.FromIntPtr(gcHandle).Target; callback.Invoke(StringHash.__FromPInvoke(type), VariantMap.__FromPInvoke(args, false)); }, __ToPInvoke(sender)); }
private void HandleEventWithType(IntPtr gcHandle, uint type, IntPtr args) { var callback = (Action <StringHash, VariantMap>)GCHandle.FromIntPtr(gcHandle).Target; callback.Invoke(StringHash.__FromPInvoke(type), VariantMap.__FromPInvoke(args, false)); }