Hello everyone,
I want to save screenshot of game in iphone gallery . but when i click on save button it saved previous screenshot . please help me it is urgent for me.
string GetDocumentsPath()
{
string DocumentsPath;
DocumentsPath = Application.dataPath.Substring (0, Application.dataPath.Length - 5);
DocumentsPath = DocumentsPath.Substring(0,DocumentsPath.LastIndexOf("/"));
return DocumentsPath + "/Documents/";
}
public void SaveWallpaperPrompt()
{
StartCoroutine( EtceteraBinding.takeScreenShot("te.png") );
saveImage(2f);
if(File.Exists (GetDocumentsPath()+"te.png"))
{
Debug.Log ("------------------- File Exits");
EtceteraBinding.saveImageToPhotoAlbum(GetDocumentsPath()+"te.png");
}
else
{
Debug.Log("------------ File NOT FOUND");
}
}
IEnumerator saveImage(float tm)
{
yield return new WaitForSeconds(tm);
}