Gallery Screenshot (iOS / Android)
This plugin will take a screenshot of your app, and register the image file so that it appears in your
picture gallery (camera roll) on both iOS and Android. It uses native extensions so you will need Unity
iOS or Unity Android (which both come as standard in Unity version 4 onwards). Tested and working
with Unity 3.5.x & 4.x.
The plugin can also take an existing image and register it to the picture gallery.
Android Setup
The asset package should import to "Assets/Plugins/" - please ensure this is the location of the files
otherwise you will run into errors.
If you are using Android, you will need to go into Build Settings and access the Player Settings panel.
Change Write Access to External (SDCard) to allow the screenshots to save.
Using the Plugin to Save a Screenshot
This plugin is initialised through a Coroutine. To take a screenshot write the following code:
StartCoroutine(ScreenshotManager.Save("screenshot_name", "album_name"));
Where screenshot_name is the file name you would like the screenshot to be saved as, and
album_name is the folder that the screenshot will be put into (and will appear as an album name on
Android). A number and time stamp will be automatically appended to each image to prevent
overwrites, i.e. MyScreenshot_1_12-03-13. This can easily be modified in the ScreenshotManager.cs
source.