- Home /
Yield www within Gui Update()
Hi, I have the problem that this isn't working:
function Update ()
{
yield openwebsite();
}
function openwebsite() {
var url: String="http://google.de";
var ww : WWW = new WWW (url);
yield ww;
Debug.LogWarning("ready");
}
Both functions are within a gui element class. So Update() updates the element. When i Write "yield openwebsite();" the gui element isn't displayed. When i write only "openwebsite();" nothing happens. I tried so many thinks, like openwebsite(): IEnemurator but nothing works, so please help me. Thanks. Btw I know that this sample doesn't make sense. But I just want to read "ready" one time..
Where's the GUI code? You don;t need the yield in Update.
The gui code is too much, it is the "Easy $$anonymous$$enu - System". The update method is called all the time. But i don't think that it is so important. The point is, that nothing happens when i use my "openwebsite" function. I never read "ready" at the Console, but when I remove the yield ww; I read it. But then I can't use the ww object..
Well if you call it from update many many times - it will go horribly wrong with the number of instances running. You should call openwebsite in reaction to something or do it in Start
Thanks, but when I call it only once it doesn't work too..
Your answer
Follow this Question
Related Questions
Stuck while solving a Coroutine problem 0 Answers
Yielding with WWW in Editor 9 Answers
Load external mp3 File without streaming 1 Answer
Another yield and www question 2 Answers
Setting Scroll View Width GUILayout 1 Answer