Hi, first, sorry for my bad english. It's not my native language. I build a WebGL (Developpment), but, I always have a message that says "out of memory" at a certain time of the game or the game froze and I have a pop-up message from the browser "Script not responding" I use Unity 5.3.4f1 Build Settings - Publishing settings WebGL Memory size : 256 Enable Exceptions : None Disable Data catching I tested my build with Firefox 45.0.1 ("out of memory" and "script not responding") I tested my build with Chrome 49.0.2623.112 m ("script not responding" and "out of memory") Build settings - Publish settings WebGL Memory size : 512 Enable Exceptions : None Disable Data catching I tested my build with Firefox 45.0.1 ("out of memory" and "script not responding") I tested my build with Chrome 49.0.2623.112 m ("script not responding" and "out of memory") The problem of memory occurs when I will show the ranking for the game. I have a call to my server to receive informations about the top 7-8 players and the information about the player (his position in the ranking). I have other calls to my server and the information that I retrieve is more bigger than ranking.
Yes, you cannot do while(!www.isDone) in WebGL, as IO in JavaScript is asynchronous, and will not complete before you give back control to the browser. So the above will result in an infinite loop.
You can check www.isDone in you Update function, but you need to return control to the browser between calls to www.isDone. If you just a loop like "do while(!www.isDone)" it will never finish, as the browser does not get a chance to get control back and finish the download.
How are you fixing this? I get "www is not ready downloading yet." With or without IEnumerator this happens. Should I separate the WWW from other code some way?