- Home /
where to call wwwLoadImageIntoTexture
Hi guys, simple question here that is stumping me:
I want to use wwwLoad to pull an asset and assign it to a target when the target is recognized on screen. Where do I use the wwwLoadImageIntoTexture function? Does it belong in the UI javascript? Do I integrate it into the event handler .cs?
Any help would be amazing, thanks.
Answer by DaveA · Sep 12, 2012 at 10:04 PM
I usually will set a flag in my UI (OnGUI) functions and have Update handle such things, because OnGUI is called several times per frame and Update just once.
Thanks! If I understand correctly, your flow would be: During OnGUI > trackable is found > call wwwLoadImageIntoTexture > continue with default trackable found fns. Correct?
Not sure what you mean by default trackable found fns, but what I mean is: declare a boolean like 'loadTextureNow' set false, then in OnGUI, when it's appropriate, set loadTextureNow to true. In Update, look for loadTextureNow being true, and when it is, do the LoadImageIntoTexture, then set loadTextureNow to false again.
Your answer
Follow this Question
Related Questions
Problem while loading an image from url 1 Answer
WWW.texture with a wildcard in the URL 1 Answer
WWW Texture Error 302 1 Answer
unity3d www download of large texture mobile 0 Answers
Coroutine and set (big?) Texture / Sprite gets noticable Lag 0 Answers