I’m trying to save a screenshot to file and need some help on exactly how to save it where I want to save it.
Here’s just a snippet of my relevant code (mostly copied straight from the Docs). Just trying to save a Texture2D as a PNG file:
var bytes = selectedPicture.EncodeToPNG(); File.WriteAllBytes(Application.dataPath + "/../SavedScreen.png", bytes);
I want the file to save to the following locations depending on platform:
Windows and Mac - Pictures
iOS and Android - Don’t care as long as it can be quickly viewed from the respective Image Gallery. I know Android is more lenient on where you put files and will create a new folder in your Gallery for each folder in the file system. Less sure about iOS on how that’s handled.
Windows Phone - I don’t have one to test yet but basically same as iOS/Android.
So what would I do for each platform?