/* * This file is part of the "House of the Future" showcase project by M2H (http://www.M2H.nl) * The original author of this code Mike Hergaarden. * Feel free to use this code for your own projects, drop me a line if you made something exciting! */ #pragma strict function SetPicture (url : String) { renderer.material.mainTexture = new Texture2D(4, 4, TextureFormat.DXT1, false); var www : WWW = new WWW(url); yield www; if(www.error && www.error!=""){ Debug.LogWarning("Error downloading painting: "+www.error+" url="+url); return; } www.LoadImageIntoTexture(renderer.material.mainTexture); }