How do I grab image from my documents path and display on plane on IOS? This code results in a ? on the plane. My path works perfect with a web view within the app and it is also successfully saving the screen capture in the photo library(camera roll). I'm using Prime31 Plugin. Thx for any help!!!!!!
function ScreenCapture(){
EtceteraBinding.takeScreenShot("image1.png");
EtceteraBinding.saveImageToPhotoAlbum(GetDocumentsPath()+"image1.png");
}
function GetDocumentsPath() : String{
var DocumentsPath : String;
DocumentsPath = Application.dataPath.Substring (0, Application.dataPath.Length - 5);
DocumentsPath = DocumentsPath.Substring(0,DocumentsPath.LastIndexOf("/"));
return DocumentsPath + "/Documents/";
}
function Start () {
ScreenCapture();
var go = new GameObject.CreatePrimitive(PrimitiveType.Plane);
var url = (GetDocumentsPath()+"image1.png");
go.renderer.material.mainTexture = new Texture2D(50, 50, TextureFormat.RGB24, false);
while(true) {
// Start a download of the given URL
var www = new WWW(url);
// wait until the download is done
yield www;
// assign the downloaded image to the main texture of the object
www.LoadImageIntoTexture(go.renderer.material.mainTexture);
}
}