private static void SaveScreenshotToDisk(string path, bool result, IntPtr pixelsPtr, int pixelsCount, TextureFormat format, int width, int height) { bool flag = MemoryProfiler.m_SaveScreenshotToDisk != null; if (flag) { Action <string, bool, DebugScreenCapture> saveScreenshotToDisk = MemoryProfiler.m_SaveScreenshotToDisk; MemoryProfiler.m_SaveScreenshotToDisk = null; DebugScreenCapture arg = default(DebugScreenCapture); if (result) { NativeArray <byte> rawImageDataReference = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray <byte>(pixelsPtr.ToPointer(), pixelsCount, Allocator.Persistent); arg.rawImageDataReference = rawImageDataReference; arg.height = height; arg.width = width; arg.imageFormat = format; } saveScreenshotToDisk(path, result, arg); } }
static void SaveScreenshotToDisk(string path, bool result, IntPtr pixelsPtr, int pixelsCount, TextureFormat format, int width, int height) { if (m_SaveScreenshotToDisk != null) { var saveScreenshotToDisk = m_SaveScreenshotToDisk; m_SaveScreenshotToDisk = null; DebugScreenCapture debugScreenCapture = default(DebugScreenCapture); if (result) { unsafe { var nonOwningNativeArray = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray <byte>(pixelsPtr.ToPointer(), pixelsCount, Allocator.Persistent); debugScreenCapture.rawImageDataReference = nonOwningNativeArray; } debugScreenCapture.height = height; debugScreenCapture.width = width; debugScreenCapture.imageFormat = format; } saveScreenshotToDisk(path, result, debugScreenCapture); } }