// Records a screenshot highlight for the given group. Attached metadata to it to make the Highlight more interesting.
        public static void SetScreenshotHighlight(ScreenshotHighlightParams screenshotHighlightParams, EmptyCallbackDelegate callback)
        {
            if (!instanceCreated)
            {
                Debug.LogError("ERROR: Cannot take a screenshot. The SDK has not been initialized.");
                return;
            }

            IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(screenshotHighlightParams));

            EmptyCallbackId cid = new EmptyCallbackId();

            cid.id       = GetCallbackId();
            cid.callback = callback;

            IntPtr asyncOp = Marshal.AllocHGlobal(Marshal.SizeOf(cid));

            try
            {
                Marshal.StructureToPtr(screenshotHighlightParams, pnt, false);
                Marshal.StructureToPtr(cid, asyncOp, false);

                Highlights_SetScreenshotHighlightAsync(pnt, asyncOp);
            }
            finally
            {
                Marshal.FreeHGlobal(pnt);
                Marshal.FreeHGlobal(asyncOp);
            }
        }
Exemple #2
0
        // Records a screenshot highlight for the given group. Attached metadata to it to make the Highlight more interesting.
        public static void SetScreenshotHighlight(ScreenshotHighlightParams screenshotHighlightParams)
        {
            if (!instanceCreated)
            {
                Debug.LogError("ERROR: Cannot take a screenshot. The SDK has not been initialized.");
                return;
            }

            IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(screenshotHighlightParams));

            try
            {
                Marshal.StructureToPtr(screenshotHighlightParams, pnt, false);
                Highlights_SetScreenshotHighlightAsync(pnt);
            }
            finally {
                Marshal.FreeHGlobal(pnt);
            }
        }