greggman / better-unity-webgl-template

A better default template for Unity WebGL
https://greggman.github.io/better-unity-webgl-template/
Creative Commons Zero v1.0 Universal
760 stars 137 forks source link

Timeout = 2000? #7

Open natebluewizard opened 5 years ago

natebluewizard commented 5 years ago

Curious what the purpose of the 2000 (2 sec) timeout before the loading screen disappears? is there a reason for that? It doesn't seem to be in the original unity webgl template so not quite sure if it serves an actual purpose in your template?

setTimeout(function() { loader.style.display = "none"; }, 2000);

Basically it adds a blanket 2 seconds to the game loading, and we're trying to shave off seconds wherever we can, so want to make sure we're safe to remove this.

Thanks!

natebluewizard commented 5 years ago

Hypothesis is that its the only way to show the bar when fully loaded... otherwise it shows @ ~90% then disappears as soon as the game is 100% (never actually showing the bar @ 100%)

greggman commented 5 years ago

This is copied from Unity so if it's not in Unity now that means they changed their default template.