public IEnumerator DownloadTexture2D() { // Create a URL and add parameters to the end of it. string myURL = "http://clientes.cheny.com.br/stephanie/es2.php"; myURL += "?webfilename=image.png&webusername=cheny&webpassword=chenyrox"; // Create our ES2Web object. ES2Web web = new ES2Web(myURL); // Start downloading our data and wait for it to finish. yield return(StartCoroutine(web.Download())); if (web.isError) { // Enter your own code to handle errors here. Debug.LogError(web.errorCode + ":" + web.error); } else { // We could save our data to a local file and load from that. //web.SaveToFile("myFile.txt"); // Or we could just load directly from the ES2Web object. //this.GetComponent<MeshFilter>().mesh = web.Load<Mesh>(tag); GetComponent <UITexture>().mainTexture = web.LoadImage(); } }
public IEnumerator DownloadTexture2D() { // Create a URL and add parameters to the end of it. string myURL = "http://clientes.cheny.com.br/stephanie/es2.php"; myURL += "?webfilename=image.png&webusername=cheny&webpassword=chenyrox"; // Create our ES2Web object. ES2Web web = new ES2Web(myURL); // Start downloading our data and wait for it to finish. yield return StartCoroutine(web.Download()); if(web.isError) { // Enter your own code to handle errors here. Debug.LogError(web.errorCode + ":" + web.error); } else { // We could save our data to a local file and load from that. //web.SaveToFile("myFile.txt"); // Or we could just load directly from the ES2Web object. //this.GetComponent<MeshFilter>().mesh = web.Load<Mesh>(tag); GetComponent<UITexture>().mainTexture = web.LoadImage(); } }