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

Commit 2249e7b

Browse files
committed
Add some folder structure to the project
1 parent 285ab2f commit 2249e7b

15 files changed

+106
-17
lines changed

Assets/WebGLTemplates/WebVR/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
<title>%UNITY_CUSTOM_NAME% | %UNITY_WEB_NAME%</title>
1111
<meta name="description" content="%UNITY_CUSTOM_DESCRIPTION%">
1212
<link rel="icon" href="favicon.ico">
13-
<link rel="stylesheet" type="text/css" href="webvr.css">
13+
<link rel="stylesheet" type="text/css" href="styles/webvr.css">
14+
<script src="src/telemetry.js"></script>
1415
<script src="%UNITY_WEBGL_LOADER_URL%"></script>
1516
<script>
1617
/* global UnityLoader */
@@ -76,8 +77,8 @@ <h3>You&rsquo;ll need a <a href="https://webvr.rocks/">WebVR-enabled browser</a>
7677
<button id="entervr" value="Enter VR"></button>
7778
</div>
7879

79-
<script src="gl-matrix-min.js"></script>
80-
<script src="webvr-polyfill.min.js"></script>
80+
<script src="lib/gl-matrix-min.js"></script>
81+
<script src="lib/webvr-polyfill.min.js"></script>
8182
<script src="webvr.js"></script>
8283
</body>
8384

Assets/WebGLTemplates/WebVR/lib.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

Assets/WebGLTemplates/WebVR/gl-matrix-min.js.meta renamed to Assets/WebGLTemplates/WebVR/lib/gl-matrix-min.js.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

Assets/WebGLTemplates/WebVR/webvr-polyfill.min.js.map renamed to Assets/WebGLTemplates/WebVR/lib/webvr-polyfill.min.js.map

File renamed without changes.

Assets/WebGLTemplates/WebVR/webvr-polyfill.min.js.map.meta renamed to Assets/WebGLTemplates/WebVR/lib/webvr-polyfill.min.js.map.meta

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

Assets/WebGLTemplates/WebVR/webvr-polyfill.min.js.meta renamed to Assets/WebGLTemplates/WebVR/lib/webvr-polyfill.min.js.meta

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

Assets/WebGLTemplates/WebVR/src.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* global localStorage, location, Raven */
2+
(function () {
3+
// This checks for "production"-looking origins (e.g., `https://example.com`).
4+
if (window.isSecureContext === false ||
5+
(location.hostname === 'localhost' ||
6+
location.hostname === '127.0.0.1' ||
7+
location.hostname === '0.0.0.0' ||
8+
location.hostname.indexOf('ngrok.io') > -1 ||
9+
location.hostname.indexOf('localtunnel.me') > -1)) {
10+
return;
11+
}
12+
13+
injectScript('https://cdn.ravenjs.com/3.22.3/console/raven.min.js', function (err) {
14+
if (err) {
15+
console.warn('Could not load Raven.js script:', err);
16+
return;
17+
}
18+
if (!('Raven' in window)) {
19+
console.warn('Could not find `window.Raven` global');
20+
return;
21+
}
22+
ravenLoaded();
23+
});
24+
25+
function ravenLoaded () {
26+
console.log('Raven.js script loaded');
27+
Raven.config('https://e359be9fb9324addb0dc97b664cf5ee6@sentry.io/294878')
28+
.install();
29+
}
30+
31+
function injectScript (src, callback) {
32+
var script = document.createElement('script');
33+
script.src = src;
34+
script.crossorigin = 'anonymous';
35+
script.addEventListener('load', function () {
36+
if (callback) {
37+
callback(null, true);
38+
}
39+
});
40+
script.addEventListener('error', function (err) {
41+
if (callback) {
42+
callback(err);
43+
}
44+
});
45+
document.head.appendChild(script);
46+
return script;
47+
}
48+
})();

0 commit comments

Comments
 (0)