Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

Load image from url in Webplayer

$
0
0
Hi, I try to load an image from an url (as texture of an 3D object). In Unity it works but in the webplayer it don't What can i do? public Texture2D TextureTemplate; // Use this for initialization void Start () { StartCoroutine(DownloadAdd1("http://www.mywebsite.com/3d/upload/TestTemplate1.png")); } // Update is called once per frame void Update () { } IEnumerator DownloadAdd1(string url) { Texture2D texture = new Texture2D(40, 40, TextureFormat.DXT1, false); WWW www = new WWW(url); yield return www; www.LoadImageIntoTexture(texture); TextureTemplate = texture; this.GetComponent().material.mainTexture = TextureTemplate; } }

Viewing all articles
Browse latest Browse all 2390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>