Skip to content
Snippets Groups Projects
Commit ffc01018 authored by Jon Gunnar Fossum's avatar Jon Gunnar Fossum
Browse files

Add demo build

parent abcecc03
No related branches found
No related tags found
No related merge requests found
Showing
with 120 additions and 0 deletions
File added
{
"companyName": "DefaultCompany",
"productName": "5G-WAR-Frontend",
"productVersion": "0.1",
"dataUrl": "Build.data.unityweb",
"wasmCodeUrl": "Build.wasm.code.unityweb",
"wasmFrameworkUrl": "Build.wasm.framework.unityweb",
"graphicsAPI": ["WebGL 2.0","WebGL 1.0"],
"webglContextAttributes": {"preserveDrawingBuffer": false},
"splashScreenStyle": "Dark",
"backgroundColor": "#231F20",
"cacheControl": {"default": "must-revalidate"},
"developmentBuild": false,
"multithreading": false,
"unityVersion": "2019.4.24f1"
}
\ No newline at end of file
File added
File added
This diff is collapsed.
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
Frontend/Build/TemplateData/favicon.ico

13 KiB

Frontend/Build/TemplateData/fullscreen.png

345 B

Frontend/Build/TemplateData/progressEmpty.Dark.png

155 B

Frontend/Build/TemplateData/progressEmpty.Light.png

159 B

Frontend/Build/TemplateData/progressFull.Dark.png

137 B

Frontend/Build/TemplateData/progressFull.Light.png

142 B

Frontend/Build/TemplateData/progressLogo.Dark.png

2.29 KiB

Frontend/Build/TemplateData/progressLogo.Light.png

2.21 KiB

.webgl-content * {border: 0; margin: 0; padding: 0}
.webgl-content {background-color: #ffffff; position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}
.webgl-content .logo, .progress {position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}
.webgl-content .logo {background: url('progressLogo.Light.png') no-repeat center / contain; width: 154px; height: 130px;}
.webgl-content .progress {height: 18px; width: 141px; margin-top: 90px;}
.webgl-content .progress .empty {background: url('progressEmpty.Light.png') no-repeat right / cover; float: right; width: 100%; height: 100%; display: inline-block;}
.webgl-content .progress .full {background: url('progressFull.Light.png') no-repeat left / cover; float: left; width: 0%; height: 100%; display: inline-block;}
.webgl-content .logo.Dark {background-image: url('progressLogo.Dark.png');}
.webgl-content .progress.Dark .empty {background-image: url('progressEmpty.Dark.png');}
.webgl-content .progress.Dark .full {background-image: url('progressFull.Dark.png');}
.webgl-content .footer {background-color: #ffffff; margin-top: 5px; height: 38px; line-height: 38px; font-family: Helvetica, Verdana, Arial, sans-serif; font-size: 18px;}
.webgl-content .footer .webgl-logo, .webxr-link, .title, .enterar, .entervr {height: 100%; display: inline-block; background: transparent center no-repeat;}
.webgl-content .footer .webgl-logo {background-image: url('webgl-logo.png'); width: 204px; float: left;}
.webgl-content .footer .webxr-link {float: left;}
.webgl-content .footer .title {margin-right: 10px; float: right;}
.webgl-content .footer .enterar:enabled {background-color: #1eaed3; width: 38px; float: right;}
.webgl-content .footer .enterar:disabled {background-color: #dddddd; width: 38px; float: right;}
.webgl-content .footer .entervr:enabled {background-color: #1eaed3; width: 38px; float: right;}
.webgl-content .footer .entervr:disabled {background-color: #dddddd; width: 38px; float: right;}
\ No newline at end of file
Frontend/Build/TemplateData/webgl-logo.png

3.5 KiB

<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | 5G-WAR-Frontend</title>
<meta name="description" content="">
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
<script src="TemplateData/UnityProgress.js"></script>
<script src="Build/UnityLoader.js"></script>
<script>
UnityLoader.compatibilityCheck = function (unityInstance, onsuccess, onerror) {
if (!UnityLoader.SystemInfo.hasWebGL) {
unityInstance.popup('Your browser does not support WebGL',
[{text: 'OK', callback: onerror}]);
} else {
onsuccess();
}
}
var unityInstance = UnityLoader.instantiate("unityContainer", "Build/Build.json", {onProgress: UnityProgress});
</script>
</head>
<body>
<div class="webgl-content">
<div id="unityContainer" style="width: 960px; height: 600px"></div>
<div class="footer">
<div class="webgl-logo"></div>
<button class="entervr" id="entervr" value="Enter VR" disabled>VR</button>
<button class="enterar" id="enterar" value="Enter AR" disabled>AR</button>
<div class="webxr-link">Using <a href="https://github.com/De-Panther/unity-webxr-export" target="_blank" title="WebXR Export">WebXR Export</a></div>
<div class="title">5G-WAR-Frontend</div>
</div>
</div>
<script>
let enterARButton = document.getElementById('enterar');
let enterVRButton = document.getElementById('entervr');
document.addEventListener('onARSupportedCheck', function (event) {
enterARButton.disabled = !event.detail.supported;
}, false);
document.addEventListener('onVRSupportedCheck', function (event) {
enterVRButton.disabled = !event.detail.supported;
}, false);
enterARButton.addEventListener('click', function (event) {
unityInstance.Module.WebXR.toggleAR();
}, false);
enterVRButton.addEventListener('click', function (event) {
unityInstance.Module.WebXR.toggleVR();
}, false);
</script>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment