Skip to content

Commit 963c165

Browse files
committed
Added a page with inputSources logs to test Hololens 2
1 parent e07b310 commit 963c165

File tree

2 files changed

+547
-0
lines changed

2 files changed

+547
-0
lines changed

Build/index_log_hololens.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6+
<title>Unity WebGL Player | Unity-WebXR-Export</title>
7+
<meta name="description" content="Complete interactive 3D scene demo made in Unity and exported to WebXR with the WebXR template of the Unity WebXR Export">
8+
<link rel="shortcut icon" href="TemplateData/favicon.ico">
9+
<link rel="stylesheet" href="TemplateData/style.css">
10+
<script src="TemplateData/UnityProgress.js"></script>
11+
<script src="Build/UnityLoader.js"></script>
12+
<script>
13+
UnityLoader.compatibilityCheck = function (unityInstance, onsuccess, onerror) {
14+
if (!UnityLoader.SystemInfo.hasWebGL) {
15+
unityInstance.popup('Your browser does not support WebGL',
16+
[{text: 'OK', callback: onerror}]);
17+
} else if (['Edge', 'Firefox', 'Chrome', 'Safari'].indexOf(UnityLoader.SystemInfo.browser) == -1 && UnityLoader.SystemInfo.os != 'iOS') {
18+
unityInstance.popup([
19+
UnityLoader.SystemInfo.os,
20+
UnityLoader.SystemInfo.browser,
21+
'No support for Unity WebGL content'
22+
].join(' '), [{text: 'OK', callback: onsuccess}]);
23+
} else {
24+
onsuccess();
25+
}
26+
}
27+
var unityInstance = UnityLoader.instantiate("unityContainer", "Build/Build.json", {onProgress: UnityProgress});
28+
</script>
29+
</head>
30+
<body>
31+
<div class="webgl-content">
32+
<div id="unityContainer" style="width: 700px; height: 400px"></div>
33+
<div class="footer">
34+
<div class="webgl-logo"></div>
35+
<button class="entervr" id="entervr" value="Enter VR" disabled>VR</button>
36+
<button class="enterar" id="enterar" value="Enter AR" disabled>AR</button>
37+
<div class="title">Unity-WebXR-Export</div>
38+
</div>
39+
</div>
40+
<script>
41+
let enterARButton = document.getElementById('enterar');
42+
let enterVRButton = document.getElementById('entervr');
43+
44+
document.addEventListener('onARSupportedCheck', function (event) {
45+
enterARButton.disabled = !event.detail.supported;
46+
}, false);
47+
document.addEventListener('onVRSupportedCheck', function (event) {
48+
enterVRButton.disabled = !event.detail.supported;
49+
}, false);
50+
51+
enterARButton.addEventListener('click', function (event) {
52+
document.dispatchEvent(new CustomEvent('toggleAR', {}));
53+
}, false);
54+
enterVRButton.addEventListener('click', function (event) {
55+
document.dispatchEvent(new CustomEvent('toggleVR', {}));
56+
}, false);
57+
</script>
58+
<script src="gl-matrix-min.js"></script>
59+
<script src="webxr_log_hololens.js"></script>
60+
</body>
61+
</html>

0 commit comments

Comments
 (0)