Esempio n. 1
0
 public void SubscribeToEvent(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));
     }, IntPtr.Zero);
 }
Esempio n. 2
0
 public void SubscribeToEvent(Object sender, StringHash eventType, Action <VariantMap> function)
 {
     Urho3D_Object_SubscribeToEvent(__ToPInvoke(this), GCHandle.ToIntPtr(GCHandle.Alloc(function)),
                                    eventType.Hash, (gcHandle, type, args) =>
     {
         var callback = (Action <VariantMap>)GCHandle.FromIntPtr(gcHandle).Target;
         callback.Invoke(VariantMap.__FromPInvoke(args, false));
     }, __ToPInvoke(sender));
 }
Esempio n. 3
0
        private void HandleEventWithoutType(IntPtr gcHandle, uint type, IntPtr args)
        {
            var callback = (Action <VariantMap>)GCHandle.FromIntPtr(gcHandle).Target;

            callback.Invoke(VariantMap.__FromPInvoke(args, false));
        }