|
function UnityProgress(unityInstance, progress) { |
|
if (!unityInstance.Module) |
|
return; |
|
if (!unityInstance.progress) { |
|
unityInstance.progress = document.createElement("div"); |
|
unityInstance.progress.className = "progress " + unityInstance.Module.splashScreenStyle; |
|
unityInstance.progress.empty = document.createElement("div"); |
|
unityInstance.progress.empty.className = "empty"; |
|
unityInstance.progress.appendChild(unityInstance.progress.empty); |
|
unityInstance.progress.full = document.createElement("div"); |
|
unityInstance.progress.full.className = "full"; |
|
unityInstance.progress.appendChild(unityInstance.progress.full); |
|
unityInstance.container.appendChild(unityInstance.progress); |
|
} |
|
|
|
if (!unityInstance.logo) { |
|
unityInstance.logo = document.createElement("div"); |
|
unityInstance.logo.className = "logo"; |
|
unityInstance.container.appendChild(unityInstance.logo); |
|
} |
|
|
|
if (!unityInstance.mokumokuran) { |
|
unityInstance.mokumokuran = document.createElement("div"); |
|
unityInstance.mokumokuran.className = "mokumokuran"; |
|
unityInstance.mokumokuran.textContent = "ローディング..."; |
|
unityInstance.container.appendChild(unityInstance.mokumokuran); |
|
} |
|
|
|
unityInstance.progress.full.style.width = (100 * progress) + "%"; |
|
unityInstance.progress.empty.style.width = (100 * (1 - progress)) + "%"; |
|
if (progress == 1) |
|
unityInstance.logo.style.display = unityInstance.progress.style.display = unityInstance.mokumokuran.style.display = "none"; |
|
} |