예제 #1
0
        public unsafe Mesh() : base(UnityInternals.object_new(InternalClassPointerStore <Mesh> .NativeClassPtr))
        {
            IntPtr returnedException = default;

            UnityInternals.runtime_invoke(m_ctor, UnityInternals.ObjectBaseToPtrNotNull(this), (void **)0, ref returnedException);
            Il2CppException.RaiseExceptionIfNecessary(returnedException);
        }
예제 #2
0
        public unsafe void Apply()
        {
            IntPtr returnedException = default;

            UnityInternals.runtime_invoke(m_Apply, UnityInternals.ObjectBaseToPtrNotNull(this), (void **)0, ref returnedException);
            Il2CppException.RaiseExceptionIfNecessary(returnedException);
        }
예제 #3
0
        public unsafe void RecalculateBounds()
        {
            UnityInternals.ObjectBaseToPtrNotNull(this);
            IntPtr returnedException = default;

            UnityInternals.runtime_invoke(m_RecalculateBounds, UnityInternals.ObjectBaseToPtrNotNull(this), (void **)0, ref returnedException);
            Il2CppException.RaiseExceptionIfNecessary(returnedException);
        }
예제 #4
0
        public unsafe Texture2D(int width, int height) : base(UnityInternals.object_new(InternalClassPointerStore <Texture2D> .NativeClassPtr))
        {
            void **args = stackalloc void *[2];

            args[0] = &width;
            args[1] = &height;
            IntPtr returnedException = default;

            UnityInternals.runtime_invoke(m_ctor, UnityInternals.ObjectBaseToPtrNotNull(this), args, ref returnedException);
            Il2CppException.RaiseExceptionIfNecessary(returnedException);
        }
예제 #5
0
        public unsafe static Type internal_from_handle(IntPtr handle)
        {
            void **args = stackalloc void *[1];

            args[0] = &handle;
            IntPtr returnedException = default;
            IntPtr intPtr            = UnityInternals.runtime_invoke(Type.m_internal_from_handle, IntPtr.Zero, (void **)args, ref returnedException);

            Il2CppException.RaiseExceptionIfNecessary(returnedException);
            return((intPtr != IntPtr.Zero) ? new Type(intPtr) : null);
        }
예제 #6
0
        public unsafe bool Populate(string str, TextGenerationSettings settings)
        {
            void **args = stackalloc void *[2];

            args[0] = (void *)UnityInternals.ManagedStringToInternal(str);
            args[1] = (void *)UnityInternals.object_unbox(UnityInternals.ObjectBaseToPtrNotNull(settings));
            IntPtr returnedException = default;
            IntPtr obj = UnityInternals.runtime_invoke(m_Populate, UnityInternals.ObjectBaseToPtrNotNull(this), args, ref returnedException);

            Il2CppException.RaiseExceptionIfNecessary(returnedException);
            return(*(bool *)UnityInternals.object_unbox(obj));
        }
예제 #7
0
        public unsafe static IntPtr GetBuiltinResource(Il2CppSystem.Type type, string path)
        {
            void **ptr = stackalloc void *[2];

            ptr[0] = (void *)UnityInternals.ObjectBaseToPtr(type);
            ptr[1] = (void *)UnityInternals.ManagedStringToInternal(path);
            IntPtr returnedException = default;

            MelonDebug.Msg("Calling runtime_invoke for GetBuiltinResource");
            IntPtr objectPointer = UnityInternals.runtime_invoke(m_GetBuiltinResource, IntPtr.Zero, ptr, ref returnedException);

            MelonDebug.Msg("returnedException: " + returnedException + ", objectPointer: " + objectPointer);
            Il2CppException.RaiseExceptionIfNecessary(returnedException);
            return(objectPointer);
        }
예제 #8
0
        unsafe public void DontDestroyOnLoad()
        {
            if (Pointer == IntPtr.Zero)
            {
                return;
            }

            void **args = stackalloc void *[1];

            args[0] = Pointer.ToPointer();

            IntPtr returnedException = IntPtr.Zero;

            UnityInternals.runtime_invoke(m_DontDestroyOnLoad, IntPtr.Zero, args, ref returnedException);
            Il2CppException.RaiseExceptionIfNecessary(returnedException);
        }