diff --git a/s/TemplateData/UnityProgress.js b/s/TemplateData/UnityProgress.js new file mode 100644 index 0000000..eb87eb3 --- /dev/null +++ b/s/TemplateData/UnityProgress.js @@ -0,0 +1,24 @@ +function UnityProgress(gameInstance, progress) { + if (!gameInstance.Module) + return; + if (!gameInstance.logo) { + gameInstance.logo = document.createElement("div"); + gameInstance.logo.className = "logo " + gameInstance.Module.splashScreenStyle; + gameInstance.container.appendChild(gameInstance.logo); + } + if (!gameInstance.progress) { + gameInstance.progress = document.createElement("div"); + gameInstance.progress.className = "progress " + gameInstance.Module.splashScreenStyle; + gameInstance.progress.empty = document.createElement("div"); + gameInstance.progress.empty.className = "empty"; + gameInstance.progress.appendChild(gameInstance.progress.empty); + gameInstance.progress.full = document.createElement("div"); + gameInstance.progress.full.className = "full"; + gameInstance.progress.appendChild(gameInstance.progress.full); + gameInstance.container.appendChild(gameInstance.progress); + } + gameInstance.progress.full.style.width = (100 * progress) + "%"; + gameInstance.progress.empty.style.width = (100 * (1 - progress)) + "%"; + if (progress == 1) + gameInstance.logo.style.display = gameInstance.progress.style.display = "none"; +} \ No newline at end of file