Skip to content

Commit 6d06857

Browse files
committed
Change don't try to do overloads of method names
1 parent d97c3d6 commit 6d06857

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Assets/Plugins/WebGL/WebBridge/CommonCommands.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,15 @@ public void CheckOnlineStatus()
302302
[WebCommand(Description = "Save current screen as PNG")]
303303
public void SaveScreenshot()
304304
{
305-
SaveScreenshot(1);
305+
SaveScreenshotSuperSize(1);
306306
}
307307

308308
/// <summary>
309309
/// Captures the current screen and saves it as a PNG file.
310310
/// </summary>
311311
/// <param name="superSize">1 for normal size, 2 for double size, 4 for quadruple size</param>
312312
[WebCommand(Description = "Save current screen as PNG with variable super size")]
313-
public void SaveScreenshot(int superSize)
313+
public void SaveScreenshotSuperSize(int superSize)
314314
{
315315
StartCoroutine(CaptureScreenshot(superSize));
316316
}
@@ -324,7 +324,7 @@ private IEnumerator CaptureScreenshot(int superSize)
324324
try
325325
{
326326
// Capture the screen
327-
var screenshot = ScreenCapture.CaptureScreenshotAsTexture(superSize);
327+
Texture2D screenshot = ScreenCapture.CaptureScreenshotAsTexture(superSize);
328328

329329
try
330330
{
@@ -334,7 +334,7 @@ private IEnumerator CaptureScreenshot(int superSize)
334334
// Download through browser
335335
WebToolPlugins.DownloadBinaryFile(filename, pngData, "image/png");
336336

337-
Debug.Log($"Screenshot saved as {filename}");
337+
Debug.Log($"Screenshot saved as {filename} ({screenshot.width}x{screenshot.height}) with size {pngData.Length} bytes");
338338
}
339339
finally
340340
{

0 commit comments

Comments
 (0)