Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 83c4156

Browse files
authored
Merge pull request #329 from caseyyee/2018-update
Unity editor 2018.2 update
2 parents d121593 + 22912fd commit 83c4156

15 files changed

+408
-436
lines changed

Build/Build/Build.data.unityweb

77.1 KB
Binary file not shown.

Build/Build/Build.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"dataUrl": "Build.data.unityweb",
55
"wasmCodeUrl": "Build.wasm.code.unityweb",
66
"wasmFrameworkUrl": "Build.wasm.framework.unityweb",
7-
"asmCodeUrl": "Build.asm.code.unityweb",
8-
"asmMemoryUrl": "Build.asm.memory.unityweb",
9-
"asmFrameworkUrl": "Build.asm.framework.unityweb",
107
"TOTAL_MEMORY": 268435456,
118
"graphicsAPI": ["WebGL 2.0", "WebGL 1.0"],
129
"webglContextAttributes": {"preserveDrawingBuffer": false},
70 KB
Binary file not shown.
-50.2 KB
Binary file not shown.

Build/Build/UnityLoader.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build/index.html

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,12 @@
3838
onProgress: unityProgress
3939
});
4040

41-
function onActivate (evt) {
42-
return new Promise(function (resolve, reject) {
43-
if (!evt.display) {
44-
return reject(new Error('No `display` property found on event'));
45-
}
46-
if (evt.reason && evt.reason !== 'navigation') {
47-
return reject(new Error("Unexpected `reason` (expected to be 'navigation')"));
48-
}
49-
if (!evt.display.capabilities || !evt.display.capabilities.canPresent) {
50-
return reject(new Error('VR display is not capable of presenting'));
51-
}
52-
gameInstance.vrDisplay = evt.display;
53-
return evt.display.requestPresent([{source: gameInstance.Module.canvas}]).then(function () {
54-
console.log('Entered VR mode');
55-
}).catch(function (err) {
56-
console.error('Unable to enter VR mode:', err);
57-
});
58-
});
59-
}
60-
window.addEventListener('vrdisplayactivate', onActivate);
61-
6241
function unityProgress (gameInstance, progress) {
6342
if (!gameInstance.progress) {
6443
gameInstance.loader = document.getElementById('loader');
6544
gameInstance.progress = document.getElementById('progress');
6645
gameInstance.loading = document.getElementById('loading');
46+
document.dispatchEvent(new CustomEvent('UnityProgressStart'));
6747
}
6848
gameInstance.progress.style.width = (100 * progress) + '%';
6949
if (progress === 1) {
@@ -95,19 +75,9 @@ <h3>You&rsquo;ll need a <a href="https://webvr.rocks/">WebVR-enabled browser</a>
9575
</div>
9676
</div>
9777

98-
<div id="vr">
99-
<div id="status">
100-
<strong>Ready!</strong>
101-
<div id="icons">
102-
<img src="vr.png" height="36" alt="VR icon">
103-
<template id="motion-controller">
104-
<img src="motion-controllers.png" height="33" alt="Motion Controller icon">
105-
</template>
106-
</div>
107-
<small><a href="https://webvr.rocks/">Not working?</a></small>
108-
</div>
109-
<button id="entervr" value="Enter VR"></button>
110-
</div>
78+
<button id="entervr" value="Enter VR"></button>
79+
80+
<div id="performance" data-enabled="false"></div>
11181

11282
<script src="vendor/gl-matrix-min.js"></script>
11383
<script src="vendor/webvr-polyfill.min.js"></script>

Build/styles/webvr.css

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,27 @@ a:link, a:visited {
8282
z-index: 0;
8383
}
8484

85-
#vr {
86-
position: absolute;
87-
display: flex;
88-
right: 30px;
89-
bottom: 30px;
90-
}
91-
9285
#status {
9386
display: none;
9487
background: #fff;
9588
margin-right: 15px;
9689
padding: 10px;
9790
}
9891

92+
#performance[data-enabled='true'] {
93+
display: block;
94+
position: absolute;
95+
left: 30px;
96+
bottom: 30px;
97+
color: #fff;
98+
padding: 10px;
99+
background: #000;
100+
}
101+
102+
#performance[data-enabled='false'] {
103+
display: none;
104+
}
105+
99106
[data-unity-loaded='true'] #status[data-enabled='true'] {
100107
display: block;
101108
}
@@ -105,12 +112,16 @@ a:link, a:visited {
105112
}
106113

107114
#entervr {
108-
background: #fff url(../vr.png) center no-repeat;
109-
background-size: 80%;
110-
cursor: pointer;
111115
display: none;
116+
position: absolute;
112117
height: 100px;
113118
width: 100px;
119+
right: 30px;
120+
bottom: 30px;
121+
background: #fff url(../vr.png) center no-repeat;
122+
background-size: 80%;
123+
border: none;
124+
cursor: pointer;
114125
}
115126

116127
[data-unity-loaded='true'] #entervr[data-enabled='true'] {
@@ -137,6 +148,7 @@ a:link, a:visited {
137148
#instruction button {
138149
color: #fff;
139150
cursor: pointer;
151+
border: none;
140152
font-size: 25px;
141153
padding: 15px 20px;
142154
}

0 commit comments

Comments
 (0)