I want to let the users of my game be able to print out a certificate that they completed a task. How can I make a link to download a png or pdf in my Unity game. Any ideas would be greatly appreciated.
To save a Texture2D from Unity to a PC (as PNG), you need to
-
Convert it to a byte:
texture.EncodeToPNG();
-
Save the byte Array
File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/face.png", textureByteArray);
–
Also, if you want to print the image in a printer, I found this: c# - Using a printer to print Unity3D Game statistics - Stack Overflow