tex | An existing texture object to be overwritten with the image data. |
Replaces the contents of an existing Texture2D with an image from the downloaded data.
yield
to see if the data is available. // Continuously get the latest webcam shot from outside "Friday's" in Times Square
// and DXT compress them at runtime
var url = "http://images.earthcam.comec_metros
ourcams/fridays.jpg"; function Start () {
// Create a texture in DXT1 format
renderer.material.mainTexture = new Texture2D(4, 4, TextureFormat.DXT1, 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(renderer.material.mainTexture);
}
}