-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
74 lines (68 loc) · 2.48 KB
/
index.html
File metadata and controls
74 lines (68 loc) · 2.48 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>LightMaterialulator</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
<!-- WebGLFileUploader -->
<script src="js/npo.src.js"></script>
<link rel="stylesheet" href="css/file_uploader.css">
<!-- -->
</head>
<body>
<div id="unity-container" class="unity-desktop">
<canvas id="unity-canvas"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
</div>
</div>
</div>
<!-- WebGLFileUploader -->
<!-- <div id="file_uploader"></div> -->
<!-- <div id="file_uploader_file_list"></div> -->
<!-- -->
<script>
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var buildUrl = "Build/";
var loaderUrl = buildUrl + "LightMaterialulator.loader.js";
var config = {
dataUrl: buildUrl + "LightMaterialulator.data",
frameworkUrl: buildUrl + "LightMaterialulator.framework.js",
codeUrl: buildUrl + "LightMaterialulator.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "r033",
productName: "LightMaterialulator",
productVersion: "1.1"
};
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
config.devicePixelRatio = 1;
canvas.style.height = "90%";
} else {
canvas.style.width = "100%";
canvas.style.height = "100%";
}
canvas.style.background = "url('" + buildUrl + "/') center / cover";
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
}).catch((message) => {
alert(message);
});
};
document.body.appendChild(script);
</script>
</body>
</html>