void ScreenshotCallback(string fpath, bool isSuccess, UnityEngine.Profiling.Experimental.DebugScreenCapture debugScreenCapture) { if (isSuccess) { Texture2D texture = new Texture2D(debugScreenCapture.width, debugScreenCapture.height, debugScreenCapture.imageFormat, false); try { var bytes = debugScreenCapture.rawImageDataReference.ToArray(); texture.LoadRawTextureData(bytes); var pngData = texture.EncodeToPNG(); var path = System.IO.Path.ChangeExtension(fpath, "png"); System.IO.File.WriteAllBytes(path, pngData); } catch (Exception e) { Debug.Log(e); } } else { Debug.Log(isSuccess); } }
static internal void Lua_System_Action_3_string_bool_UnityEngine_Profiling_Experimental_DebugScreenCapture(LuaFunction ld, string a1, bool a2, UnityEngine.Profiling.Experimental.DebugScreenCapture a3) { IntPtr l = ld.L; int error = pushTry(l); pushValue(l, a1); pushValue(l, a2); pushValue(l, a3); ld.pcall(3, error); LuaDLL.lua_settop(l, error - 1); }