Beispiel #1
0
        public static void SetGeneralDestructor(IntPtr isolate, V8DestructorCallback generalDestructor)
        {
#if PUERTS_GENERAL || (UNITY_WSA && !UNITY_EDITOR)
            GCHandle.Alloc(generalDestructor);
#endif
            IntPtr fn = generalDestructor == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(generalDestructor);
            SetGeneralDestructor(isolate, fn);
        }
Beispiel #2
0
        public static int RegisterStruct(IntPtr isolate, int BaseTypeId, string fullName, V8ConstructorCallback constructor, V8DestructorCallback destructor, long data, int size)
        {
#if PUERTS_GENERAL || (UNITY_WSA && !UNITY_EDITOR)
            GCHandle.Alloc(constructor);
            GCHandle.Alloc(destructor);
#endif
            IntPtr fn1 = constructor == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(constructor);
            IntPtr fn2 = destructor == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(destructor);

            return(RegisterStruct(isolate, BaseTypeId, fullName, fn1, fn2, data, size));
        }
Beispiel #3
0
 public static extern int RegisterStruct(IntPtr isolate, int BaseTypeId, string fullName, V8ConstructorCallback constructor, V8DestructorCallback destructor, long data, int size);
Beispiel #4
0
 public static extern void SetGeneralDestructor(IntPtr isolate, V8DestructorCallback generalDestructor);