- Home /
Can I use WWW in Start()?
Hi, I'm using WWW to initiate gameobjects, it looks must return IEnumerator, but once I try IEnumerator Start(), the scene always begin before Start() has finished(because of yield return within WWW).
Can I block UI thread while using WWW or let scene begin after Start() fully load? Cheers!
Answer by Mortoc · Feb 04, 2014 at 06:59 PM
Nope, you can't block while waiting for a Web request, nor would you want to (your app will appear to have crashed).
You can split your app in to 2 scenes, 1 would be the loading scene that does the WWW request and then loads your main scene. Any data that the WWW gets can be stored on your gameObject by marking it as "don't destroy on load".
http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html
Thanks dude, your answer inspire me, I use a curtain ins$$anonymous$$d eventually