Пример #1
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));
        }
Пример #2
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);
        }