unity-webgl-responsive icon indicating copy to clipboard operation
unity-webgl-responsive copied to clipboard

Unity 2020 template is missing loader / progress bar

Open sno opened this issue 4 years ago • 4 comments

The progress bar instantiated in the 201X template is missing in the 2020 one.

sno avatar Mar 21 '21 17:03 sno

I made it work, at least it works for me, just adding some code lines In the Index.html i add two divs inside the unitycontainer div (line 28) `` < div id="unityContainer">

      <div id="LoadContainer" style="display: block; position: absolute; top: 50%; left: 50%; margin-left: -100px; margin-top: -7px; height: 15px; width: 200px; border-style: solid; border: color #999; border-width: 1px; z-index: 9;">

      <div id="LoadBar" style="display: block; background-color: white; height: 15px; width: 0px; z-index: 10;"></div>
      </div>

      <canvas id="unity-canvas" style="background: #231F20;"></canvas>

    </div>``

in MyLoader.js i add a few lines to hide the two divs when the canvas content if fully loaded, line 294 `` var LBar = document.getElementById("LoadBar");

var CBar = document.getElementById("LoadContainer");

LBar.style.width = totalProgress*200+"px";

if(totalProgress == 1){

  CBar.style.display="none";

}``

I works for me, you can try

ElyonSTD avatar Mar 22 '21 23:03 ElyonSTD

thanks man it works but insert the javascript code in line 292

made21 avatar Jan 05 '22 08:01 made21

By 292, you mean insert it inside the Error Hanlder function?

saadjumani avatar Apr 15 '22 15:04 saadjumani

couldnt get it to work. Where did you put this exactly? Could you please help?

firativerson avatar Jul 12 '22 17:07 firativerson