var error : string
Description
Returns an error message if there was an error during the download (Read Only).
If there was no error, error will return null.
If the object has not finished downloading the data, it will block until the download has finished.
Use isDone or yield to see if the data is available.
var url =
"invalid_url";
function Start () {
var www : WWW =
new WWW (url);
yield www;
if (www.error != null)
Debug.Log(www.error);
renderer.material.mainTexture = www.texture;
}
using UnityEngine;
using System.Collections;
public class example :
MonoBehaviour {
public string url =
"invalid_url";
IEnumerator
Start() {
WWW www =
new WWW(url);
yield return www;
if (www.error != null)
Debug.Log(www.error);
renderer.material.mainTexture = www.texture;
}
}
import UnityEngine
import System.Collections
class example(
MonoBehaviour):
public url as
string = 'invalid_url'
def
Start() as IEnumerator:
www as WWW = WWW(url)
yield www
if www.error != null:
Debug.Log(www.error)
renderer.material.mainTexture = www.texture