Tuesday, October 4
Shadow

Download PNG file blob from webgl (without server)

/ https://forum.unity.com/threads/user-image-download-from-in-webgl-app.474715/#post-3698248
[DllImport("__Internal")]
private static extern void DownloadFile(byte[] array, int byteLength, string fileName);
 
var texture = ScreenCapture.CaptureScreenshotAsTexture();
byte[] textureBytes = texture.EncodeToPNG();
DownloadFile(textureBytes, textureBytes.Length, "screenshot.png");
Destroy(texture);

Leave a Reply