better-unity-webgl-template icon indicating copy to clipboard operation
better-unity-webgl-template copied to clipboard

Timeout = 2000?

Open natebluewizard opened this issue 6 years ago • 2 comments

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 avatar Apr 18 '19 17:04 natebluewizard

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%)

natebluewizard avatar Apr 18 '19 17:04 natebluewizard

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

greggman avatar Apr 18 '19 22:04 greggman