-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (54 loc) · 2.39 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!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 | %UNITY_WEB_NAME%</title>
<meta name="description" content="%UNITY_CUSTOM_DESCRIPTION%">
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
<script src="TemplateData/UnityProgress.js"></script>
<script src="%UNITY_WEBGL_LOADER_URL%"></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", "%UNITY_WEBGL_BUILD_URL%", {onProgress: UnityProgress});
</script>
</head>
<body>
<div class="webgl-content">
<div id="unityContainer" style="width: %UNITY_WIDTH%px; height: %UNITY_HEIGHT%px"></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">From <a href="https://www.youtube.com/channel/UCCxGucNZMsIEQ_qc51gf72w?view_as=subscriber" target="_blank" title="WebXR Export">AllinReality</a></div>
<div class="title">%UNITY_WEB_NAME%</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) {
document.dispatchEvent(new CustomEvent('toggleAR', {}));
}, false);
enterVRButton.addEventListener('click', function (event) {
document.dispatchEvent(new CustomEvent('toggleVR', {}));
}, false);
</script>
<script src="gl-matrix-min.js"></script>
<script src="webxr.js"></script>
</body>
</html>