예제 #1
0
        public unsafe void Apply()
        {
            IntPtr returnedException = default;

            UnityInternals.runtime_invoke(m_Apply, UnityInternals.ObjectBaseToPtrNotNull(this), (void **)0, ref returnedException);
            Il2CppException.RaiseExceptionIfNecessary(returnedException);
        }
예제 #2
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);
        }
예제 #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 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));
        }
예제 #6
0
        public unsafe static void DrawTexture(Rect screenRect, Texture2D texture)
        {
            if ((texture == null) || (texture.Pointer == IntPtr.Zero))
            {
                return;
            }

            if (m_DrawTexture_Internal_struct == 0)
            {
                Internal_DrawTextureArguments_2017 args = default;
                args.screenRect = screenRect;
                args.sourceRect = new Rect(0, 0, 1, 1);
                args.color      = new Color32(128, 128, 128, 128);
                args.texture    = UnityInternals.ObjectBaseToPtrNotNull(texture);
                fd_Internal_DrawTexture((IntPtr)(&args));
            }
            else if (m_DrawTexture_Internal_struct == 1)
            {
                Internal_DrawTextureArguments_2018 args = default;
                args.screenRect = screenRect;
                args.sourceRect = new Rect(0, 0, 1, 1);
                args.color      = new Color32(128, 128, 128, 128);
                args.texture    = UnityInternals.ObjectBaseToPtrNotNull(texture);
                fd_Internal_DrawTexture((IntPtr)(&args));
            }
            else if (m_DrawTexture_Internal_struct == 2)
            {
                Internal_DrawTextureArguments_2019 args = default;
                args.screenRect = screenRect;
                args.sourceRect = new Rect(0, 0, 1, 1);
                args.color      = new Color(0.5f, 0.5f, 0.5f, 0.5f);
                args.texture    = UnityInternals.ObjectBaseToPtrNotNull(texture);
                fd_Internal_DrawTexture((IntPtr)(&args));
            }
            else if (m_DrawTexture_Internal_struct == 3)
            {
                Internal_DrawTextureArguments_2020 args = default;
                args.screenRect        = screenRect;
                args.sourceRect        = new Rect(0, 0, 1, 1);
                args.color             = new Color(0.5f, 0.5f, 0.5f, 0.5f);
                args.leftBorderColor   = new Color(0, 0, 0, 1);
                args.topBorderColor    = new Color(0, 0, 0, 1);
                args.rightBorderColor  = new Color(0, 0, 0, 1);
                args.bottomBorderColor = new Color(0, 0, 0, 1);
                args.smoothCorners     = true;
                args.texture           = UnityInternals.ObjectBaseToPtrNotNull(texture);
                fd_Internal_DrawTexture((IntPtr)(&args));
            }
        }
예제 #7
0
        public unsafe UIVertexWrapper[] GetVerticesArray()
        {
            IntPtr intPtr = fd_GetVerticesArray(UnityInternals.ObjectBaseToPtrNotNull(this));

            if (intPtr == IntPtr.Zero)
            {
                return(null);
            }
            UIVertexWrapper[] arr = new UIVertexWrapper[UnityInternals.array_length(intPtr)];
            for (int i = 0; i < arr.Length; ++i)
            {
                arr[i] = new UIVertexWrapper((IntPtr)((long)intPtr + 4 * IntPtr.Size + i * UIVertexWrapper.sizeOfElement));
            }
            // arr[i] =  ( (UIVertex*)((long)intPtr + 4 * IntPtr.Size) )[i];
            // arr[i] = *( (UIVertex*)((long)intPtr + 4 * IntPtr.Size) + (i * sizeof(UIVertex)))
            return(arr);
        }
예제 #8
0
        public unsafe void SetPixelsImpl(int x, int y, int w, int h, Color[] pixel, int miplevel, int frame)
        {
            IntPtr pixelArrayPtr = UnityInternals.array_new(InternalClassPointerStore <Color> .NativeClassPtr, (uint)pixel.Length);

            for (var i = 0; i < pixel.Length; i++)
            {
                IntPtr arrayStartPointer = (IntPtr)((long)pixelArrayPtr + 4 * IntPtr.Size);
                ((Color *)arrayStartPointer.ToPointer())[i] = pixel[i];
            }

            if (type_SetPixelsImpl == 0)
            {
                m_SetPixelsImpl_2017(UnityInternals.ObjectBaseToPtrNotNull(this), x, y, w, h, pixelArrayPtr, miplevel);
            }
            else if (type_SetPixelsImpl == 1)
            {
                m_SetPixelsImpl_2018(UnityInternals.ObjectBaseToPtrNotNull(this), x, y, w, h, pixelArrayPtr, miplevel, frame);
            }
        }
예제 #9
0
 private unsafe void SetArrayForChannelImpl(int channel, IntPtr values, int channelDimensions, int valuesCount)
 {
     if (type_SetArrayForChannelImpl == 0)
     {
         m_SetArrayForChannelImpl_2017(UnityInternals.ObjectBaseToPtrNotNull(this), channel, 0 /* float */, channelDimensions, values, valuesCount);
     }
     else if (type_SetArrayForChannelImpl == 1)
     {
         m_SetArrayForChannelImpl_2019(UnityInternals.ObjectBaseToPtrNotNull(this), channel, 0 /* float */, channelDimensions, values, valuesCount, 0, valuesCount);
     }
     else if (type_SetArrayForChannelImpl == 2)
     {
         m_SetArrayForChannelImpl_2020(UnityInternals.ObjectBaseToPtrNotNull(this), channel, 0 /* float */, channelDimensions, values, valuesCount, 0, valuesCount, 0 /* MeshUpdateFlags.Default */);
     }
     else
     {
         throw new NotImplementedException("SetArrayForChannel isn't implemented for this version of Unity");
     }
 }
예제 #10
0
 public unsafe bool SetPass(int pass)
 {
     return(m_SetPass(UnityInternals.ObjectBaseToPtrNotNull(this), pass));
 }