Unity 2020 template is missing loader / progress bar
The progress bar instantiated in the 201X template is missing in the 2020 one.
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
thanks man it works but insert the javascript code in line 292
By 292, you mean insert it inside the Error Hanlder function?
couldnt get it to work. Where did you put this exactly? Could you please help?