From 6d068571a46ad7b7962988bcd80be9642febdb83 Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Mon, 16 Dec 2024 23:14:46 +0100 Subject: [PATCH] Change don't try to do overloads of method names --- Assets/Plugins/WebGL/WebBridge/CommonCommands.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Plugins/WebGL/WebBridge/CommonCommands.cs b/Assets/Plugins/WebGL/WebBridge/CommonCommands.cs index bdd2022..d4d48e2 100644 --- a/Assets/Plugins/WebGL/WebBridge/CommonCommands.cs +++ b/Assets/Plugins/WebGL/WebBridge/CommonCommands.cs @@ -302,7 +302,7 @@ public void CheckOnlineStatus() [WebCommand(Description = "Save current screen as PNG")] public void SaveScreenshot() { - SaveScreenshot(1); + SaveScreenshotSuperSize(1); } /// @@ -310,7 +310,7 @@ public void SaveScreenshot() /// /// 1 for normal size, 2 for double size, 4 for quadruple size [WebCommand(Description = "Save current screen as PNG with variable super size")] - public void SaveScreenshot(int superSize) + public void SaveScreenshotSuperSize(int superSize) { StartCoroutine(CaptureScreenshot(superSize)); } @@ -324,7 +324,7 @@ private IEnumerator CaptureScreenshot(int superSize) try { // Capture the screen - var screenshot = ScreenCapture.CaptureScreenshotAsTexture(superSize); + Texture2D screenshot = ScreenCapture.CaptureScreenshotAsTexture(superSize); try { @@ -334,7 +334,7 @@ private IEnumerator CaptureScreenshot(int superSize) // Download through browser WebToolPlugins.DownloadBinaryFile(filename, pngData, "image/png"); - Debug.Log($"Screenshot saved as {filename}"); + Debug.Log($"Screenshot saved as {filename} ({screenshot.width}x{screenshot.height}) with size {pngData.Length} bytes"); } finally {