Skip to content

Commit

Permalink
Change don't try to do overloads of method names
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesDeml committed Dec 16, 2024
1 parent d97c3d6 commit 6d06857
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Assets/Plugins/WebGL/WebBridge/CommonCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ public void CheckOnlineStatus()
[WebCommand(Description = "Save current screen as PNG")]
public void SaveScreenshot()
{
SaveScreenshot(1);
SaveScreenshotSuperSize(1);
}

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

try
{
Expand All @@ -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
{
Expand Down

0 comments on commit 6d06857

Please sign in to comment.