From 280185245d19c7c9c02e5c73601e0e54009c6c8e Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 14 Feb 2021 15:27:29 -0500 Subject: Added unity project --- public/unity/TemplateData/UnityProgress.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 public/unity/TemplateData/UnityProgress.js (limited to 'public/unity/TemplateData/UnityProgress.js') diff --git a/public/unity/TemplateData/UnityProgress.js b/public/unity/TemplateData/UnityProgress.js new file mode 100644 index 0000000..ceb0543 --- /dev/null +++ b/public/unity/TemplateData/UnityProgress.js @@ -0,0 +1,24 @@ +function UnityProgress(unityInstance, progress) { + if (!unityInstance.Module) + return; + if (!unityInstance.logo) { + unityInstance.logo = document.createElement("div"); + unityInstance.logo.className = "logo " + unityInstance.Module.splashScreenStyle; + unityInstance.container.appendChild(unityInstance.logo); + } + 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); + } + 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 = "none"; +} \ No newline at end of file -- cgit v1.2.3