Skip to content

Instantly share code, notes, and snippets.

@kirillrybin
Last active October 6, 2015 12:49
Show Gist options
  • Save kirillrybin/1be1a5e245800f141a8e to your computer and use it in GitHub Desktop.
Save kirillrybin/1be1a5e245800f141a8e to your computer and use it in GitHub Desktop.
Save image with Etcetera plugin for Unity3D
byte [] bytes = www.texture.EncodeToPNG();
string filename = System.IO.Path.Combine(Application.persistentDataPath, "MyTextureName.png");
System.IO.File.WriteAllBytes(filename, bytes);
#if UNITY_IPHONE
EtceteraBinding.saveImageToPhotoAlbum(filename);
#elif UNITY_ANDROID
EtceteraAndroid.saveImageToGallery(filename, "MyTextureName.png");
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment