chengzl18 commited on
Commit
2471a0a
1 Parent(s): ddffa8d

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -42,3 +42,5 @@ StreamingAssets/aa/WebGL/lowpolyinterior2_assets_all_6a358124a3158379fde21dcea9b
42
  StreamingAssets/aa/WebGL/lowpolyinterior_assets_all_5707d9cbfca59c62703d7a4a7f270498.bundle filter=lfs diff=lfs merge=lfs -text
43
  StreamingAssets/aa/WebGL/worldmaterials_assets_all_92ac8f5a0105bc32c613119d67548b02.bundle filter=lfs diff=lfs merge=lfs -text
44
  StreamingAssets/aa/WebGL/worldmaterialsfree_assets_all_d35d2232fc409787f0be9099c69e9a68.bundle filter=lfs diff=lfs merge=lfs -text
 
 
 
42
  StreamingAssets/aa/WebGL/lowpolyinterior_assets_all_5707d9cbfca59c62703d7a4a7f270498.bundle filter=lfs diff=lfs merge=lfs -text
43
  StreamingAssets/aa/WebGL/worldmaterials_assets_all_92ac8f5a0105bc32c613119d67548b02.bundle filter=lfs diff=lfs merge=lfs -text
44
  StreamingAssets/aa/WebGL/worldmaterialsfree_assets_all_d35d2232fc409787f0be9099c69e9a68.bundle filter=lfs diff=lfs merge=lfs -text
45
+ Build/202405050231.data filter=lfs diff=lfs merge=lfs -text
46
+ StreamingAssets/aa/WebGL/lowpolyinterior2_assets_all_4a73d1ff1ebc52c3da3dcf77de554510.bundle filter=lfs diff=lfs merge=lfs -text
Build/202405050231.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80306b3555663ff2950bd556ce14e733547d2c826afd182a2231e9f0f3881e54
3
+ size 71135744
Build/202405050231.framework.js ADDED
The diff for this file is too large to render. See raw diff
 
Build/202405050231.loader.js ADDED
@@ -0,0 +1,1268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function createUnityInstance(canvas, config, onProgress) {
2
+ onProgress = onProgress || function () {};
3
+
4
+
5
+ function showBanner(msg, type) {
6
+ // Only ever show one error at most - other banner messages after that should get ignored
7
+ // to avoid noise.
8
+ if (!showBanner.aborted && config.showBanner) {
9
+ if (type == 'error') showBanner.aborted = true;
10
+ return config.showBanner(msg, type);
11
+ }
12
+
13
+ // Fallback to console logging if visible banners have been suppressed
14
+ // from the main page.
15
+ switch(type) {
16
+ case 'error': console.error(msg); break;
17
+ case 'warning': console.warn(msg); break;
18
+ default: console.log(msg); break;
19
+ }
20
+ }
21
+
22
+ function errorListener(e) {
23
+ var error = e.reason || e.error;
24
+ var message = error ? error.toString() : (e.message || e.reason || '');
25
+ var stack = (error && error.stack) ? error.stack.toString() : '';
26
+
27
+ // Do not repeat the error message if it's present in the stack trace.
28
+ if (stack.startsWith(message)) {
29
+ stack = stack.substring(message.length);
30
+ }
31
+
32
+ message += '\n' + stack.trim();
33
+
34
+ if (!message || !Module.stackTraceRegExp || !Module.stackTraceRegExp.test(message))
35
+ return;
36
+
37
+ var filename = e.filename || (error && (error.fileName || error.sourceURL)) || '';
38
+ var lineno = e.lineno || (error && (error.lineNumber || error.line)) || 0;
39
+
40
+ errorHandler(message, filename, lineno);
41
+ }
42
+
43
+ function fallbackToDefaultConfigWithWarning(config, key, defaultValue) {
44
+ var value = config[key];
45
+
46
+ if (typeof value === "undefined" || !value) {
47
+ console.warn("Config option \"" + key + "\" is missing or empty. Falling back to default value: \"" + defaultValue + "\". Consider updating your WebGL template to include the missing config option.");
48
+ config[key] = defaultValue;
49
+ }
50
+ }
51
+
52
+ var Module = {
53
+ canvas: canvas,
54
+ webglContextAttributes: {
55
+ preserveDrawingBuffer: false,
56
+ powerPreference: 2,
57
+ },
58
+ cacheControl: function (url) {
59
+ return (url == Module.dataUrl || url.match(/\.bundle/)) ? "must-revalidate" : "no-store";
60
+ },
61
+ streamingAssetsUrl: "StreamingAssets",
62
+ downloadProgress: {},
63
+ deinitializers: [],
64
+ intervals: {},
65
+ setInterval: function (func, ms) {
66
+ var id = window.setInterval(func, ms);
67
+ this.intervals[id] = true;
68
+ return id;
69
+ },
70
+ clearInterval: function(id) {
71
+ delete this.intervals[id];
72
+ window.clearInterval(id);
73
+ },
74
+ preRun: [],
75
+ postRun: [],
76
+ print: function (message) {
77
+ console.log(message);
78
+ },
79
+ printErr: function (message) {
80
+ console.error(message);
81
+
82
+ if (typeof message === 'string' && message.indexOf('wasm streaming compile failed') != -1) {
83
+ if (message.toLowerCase().indexOf('mime') != -1) {
84
+ showBanner('HTTP Response Header "Content-Type" configured incorrectly on the server for file ' + Module.codeUrl + ' , should be "application/wasm". Startup time performance will suffer.', 'warning');
85
+ } else {
86
+ showBanner('WebAssembly streaming compilation failed! This can happen for example if "Content-Encoding" HTTP header is incorrectly enabled on the server for file ' + Module.codeUrl + ', but the file is not pre-compressed on disk (or vice versa). Check the Network tab in browser Devtools to debug server header configuration.', 'warning');
87
+ }
88
+ }
89
+ },
90
+ locateFile: function (url) {
91
+ if (url == "build.wasm") return this.codeUrl;
92
+ return url;
93
+ },
94
+ disabledCanvasEvents: [
95
+ "contextmenu",
96
+ "dragstart",
97
+ ],
98
+ };
99
+
100
+ // Add fallback values for companyName, productName and productVersion to ensure that the UnityCache is working.
101
+ fallbackToDefaultConfigWithWarning(config, "companyName", "Unity");
102
+ fallbackToDefaultConfigWithWarning(config, "productName", "WebGL Player");
103
+ fallbackToDefaultConfigWithWarning(config, "productVersion", "1.0");
104
+
105
+ for (var parameter in config)
106
+ Module[parameter] = config[parameter];
107
+
108
+ Module.streamingAssetsUrl = new URL(Module.streamingAssetsUrl, document.URL).href;
109
+
110
+ // Operate on a clone of Module.disabledCanvasEvents field so that at Quit time
111
+ // we will ensure we'll remove the events that we created (in case user has
112
+ // modified/cleared Module.disabledCanvasEvents in between)
113
+ var disabledCanvasEvents = Module.disabledCanvasEvents.slice();
114
+
115
+ function preventDefault(e) {
116
+ e.preventDefault();
117
+ }
118
+
119
+ disabledCanvasEvents.forEach(function (disabledCanvasEvent) {
120
+ canvas.addEventListener(disabledCanvasEvent, preventDefault);
121
+ });
122
+
123
+ window.addEventListener("error", errorListener);
124
+ window.addEventListener("unhandledrejection", errorListener);
125
+
126
+ // Safari does not automatically stretch the fullscreen element to fill the screen.
127
+ // The CSS width/height of the canvas causes it to remain the same size in the full screen
128
+ // window on Safari, resulting in it being a small canvas with black borders filling the
129
+ // rest of the screen.
130
+ var _savedElementWidth = "";
131
+ var _savedElementHeight = "";
132
+ // Safari uses webkitfullscreenchange event and not fullscreenchange
133
+ document.addEventListener("webkitfullscreenchange", function(e) {
134
+ // Safari uses webkitCurrentFullScreenElement and not fullscreenElement.
135
+ var fullscreenElement = document.webkitCurrentFullScreenElement;
136
+ if (fullscreenElement === canvas) {
137
+ if (canvas.style.width) {
138
+ _savedElementWidth = canvas.style.width;
139
+ _savedElementHeight = canvas.style.height;
140
+ canvas.style.width = "100%";
141
+ canvas.style.height = "100%";
142
+ }
143
+ } else {
144
+ if (_savedElementWidth) {
145
+ canvas.style.width = _savedElementWidth;
146
+ canvas.style.height = _savedElementHeight;
147
+ _savedElementWidth = "";
148
+ _savedElementHeight = "";
149
+ }
150
+ }
151
+ });
152
+
153
+ // Clear the event handlers we added above when the app quits, so that the event handler
154
+ // functions will not hold references to this JS function scope after
155
+ // exit, to allow JS garbage collection to take place.
156
+ Module.deinitializers.push(function() {
157
+ Module['disableAccessToMediaDevices']();
158
+ disabledCanvasEvents.forEach(function (disabledCanvasEvent) {
159
+ canvas.removeEventListener(disabledCanvasEvent, preventDefault);
160
+ });
161
+ window.removeEventListener("error", errorListener);
162
+ window.removeEventListener("unhandledrejection", errorListener);
163
+
164
+ for (var id in Module.intervals)
165
+ {
166
+ window.clearInterval(id);
167
+ }
168
+ Module.intervals = {};
169
+ });
170
+
171
+ Module.QuitCleanup = function () {
172
+ for (var i = 0; i < Module.deinitializers.length; i++) {
173
+ Module.deinitializers[i]();
174
+ }
175
+ Module.deinitializers = [];
176
+ // After all deinitializer callbacks are called, notify user code that the Unity game instance has now shut down.
177
+ if (typeof Module.onQuit == "function")
178
+ Module.onQuit();
179
+
180
+ };
181
+
182
+ var unityInstance = {
183
+ Module: Module,
184
+ SetFullscreen: function () {
185
+ if (Module.SetFullscreen)
186
+ return Module.SetFullscreen.apply(Module, arguments);
187
+ Module.print("Failed to set Fullscreen mode: Player not loaded yet.");
188
+ },
189
+ SendMessage: function () {
190
+ if (Module.SendMessage)
191
+ return Module.SendMessage.apply(Module, arguments);
192
+ Module.print("Failed to execute SendMessage: Player not loaded yet.");
193
+ },
194
+ Quit: function () {
195
+ return new Promise(function (resolve, reject) {
196
+ Module.shouldQuit = true;
197
+ Module.onQuit = resolve;
198
+ });
199
+ },
200
+ GetMemoryInfo: function () {
201
+ var memInfoPtr = Module._getMemInfo();
202
+ return {
203
+ totalWASMHeapSize: Module.HEAPU32[memInfoPtr >> 2],
204
+ usedWASMHeapSize: Module.HEAPU32[(memInfoPtr >> 2) + 1],
205
+ totalJSHeapSize: Module.HEAPF64[(memInfoPtr >> 3) + 1],
206
+ usedJSHeapSize: Module.HEAPF64[(memInfoPtr >> 3) + 2]
207
+ };
208
+ },
209
+ };
210
+
211
+
212
+ Module.SystemInfo = (function () {
213
+
214
+ var browser, browserVersion, os, osVersion, canvas, gpu;
215
+
216
+ var ua = navigator.userAgent + ' ';
217
+ var browsers = [
218
+ ['Firefox', 'Firefox'],
219
+ ['OPR', 'Opera'],
220
+ ['Edg', 'Edge'],
221
+ ['SamsungBrowser', 'Samsung Browser'],
222
+ ['Trident', 'Internet Explorer'],
223
+ ['MSIE', 'Internet Explorer'],
224
+ ['Chrome', 'Chrome'],
225
+ ['CriOS', 'Chrome on iOS Safari'],
226
+ ['FxiOS', 'Firefox on iOS Safari'],
227
+ ['Safari', 'Safari'],
228
+ ];
229
+
230
+ function extractRe(re, str, idx) {
231
+ re = RegExp(re, 'i').exec(str);
232
+ return re && re[idx];
233
+ }
234
+ for(var b = 0; b < browsers.length; ++b) {
235
+ browserVersion = extractRe(browsers[b][0] + '[\/ ](.*?)[ \\)]', ua, 1);
236
+ if (browserVersion) {
237
+ browser = browsers[b][1];
238
+ break;
239
+ }
240
+ }
241
+ if (browser == 'Safari') browserVersion = extractRe('Version\/(.*?) ', ua, 1);
242
+ if (browser == 'Internet Explorer') browserVersion = extractRe('rv:(.*?)\\)? ', ua, 1) || browserVersion;
243
+
244
+ // These OS strings need to match the ones in Runtime/Misc/SystemInfo.cpp::GetOperatingSystemFamily()
245
+ var oses = [
246
+ ['Windows (.*?)[;\)]', 'Windows'],
247
+ ['Android ([0-9_\.]+)', 'Android'],
248
+ ['iPhone OS ([0-9_\.]+)', 'iPhoneOS'],
249
+ ['iPad.*? OS ([0-9_\.]+)', 'iPadOS'],
250
+ ['FreeBSD( )', 'FreeBSD'],
251
+ ['OpenBSD( )', 'OpenBSD'],
252
+ ['Linux|X11()', 'Linux'],
253
+ ['Mac OS X ([0-9_\.]+)', 'MacOS'],
254
+ ['bot|google|baidu|bing|msn|teoma|slurp|yandex', 'Search Bot']
255
+ ];
256
+ for(var o = 0; o < oses.length; ++o) {
257
+ osVersion = extractRe(oses[o][0], ua, 1);
258
+ if (osVersion) {
259
+ os = oses[o][1];
260
+ osVersion = osVersion.replace(/_/g, '.');
261
+ break;
262
+ }
263
+ }
264
+ var versionMappings = {
265
+ 'NT 5.0': '2000',
266
+ 'NT 5.1': 'XP',
267
+ 'NT 5.2': 'Server 2003',
268
+ 'NT 6.0': 'Vista',
269
+ 'NT 6.1': '7',
270
+ 'NT 6.2': '8',
271
+ 'NT 6.3': '8.1',
272
+ 'NT 10.0': '10'
273
+ };
274
+ osVersion = versionMappings[osVersion] || osVersion;
275
+
276
+ // TODO: Add mobile device identifier, e.g. SM-G960U
277
+
278
+ canvas = document.createElement("canvas");
279
+ if (canvas) {
280
+ gl = canvas.getContext("webgl2");
281
+ glVersion = gl ? 2 : 0;
282
+ if (!gl) {
283
+ if (gl = canvas && canvas.getContext("webgl")) glVersion = 1;
284
+ }
285
+
286
+ if (gl) {
287
+ gpu = (gl.getExtension("WEBGL_debug_renderer_info") && gl.getParameter(0x9246 /*debugRendererInfo.UNMASKED_RENDERER_WEBGL*/)) || gl.getParameter(0x1F01 /*gl.RENDERER*/);
288
+ }
289
+ }
290
+
291
+ var hasThreads = typeof SharedArrayBuffer !== 'undefined';
292
+ var hasWasm = typeof WebAssembly === "object" && typeof WebAssembly.compile === "function";
293
+ return {
294
+ width: screen.width,
295
+ height: screen.height,
296
+ userAgent: ua.trim(),
297
+ browser: browser || 'Unknown browser',
298
+ browserVersion: browserVersion || 'Unknown version',
299
+ mobile: /Mobile|Android|iP(ad|hone)/.test(navigator.appVersion),
300
+ os: os || 'Unknown OS',
301
+ osVersion: osVersion || 'Unknown OS Version',
302
+ gpu: gpu || 'Unknown GPU',
303
+ language: navigator.userLanguage || navigator.language,
304
+ hasWebGL: glVersion,
305
+ hasCursorLock: !!document.body.requestPointerLock,
306
+ hasFullscreen: !!document.body.requestFullscreen || !!document.body.webkitRequestFullscreen, // Safari still uses the webkit prefixed version
307
+ hasThreads: hasThreads,
308
+ hasWasm: hasWasm,
309
+ // This should be updated when we re-enable wasm threads. Previously it checked for WASM thread
310
+ // support with: var wasmMemory = hasWasm && hasThreads && new WebAssembly.Memory({"initial": 1, "maximum": 1, "shared": true});
311
+ // which caused Chrome to have a warning that SharedArrayBuffer requires cross origin isolation.
312
+ hasWasmThreads: false,
313
+ };
314
+ })();
315
+
316
+ function errorHandler(message, filename, lineno) {
317
+ // Unity needs to rely on Emscripten deferred fullscreen requests, so these will make their way to error handler
318
+ if (message.indexOf('fullscreen error') != -1)
319
+ return;
320
+
321
+ if (Module.startupErrorHandler) {
322
+ Module.startupErrorHandler(message, filename, lineno);
323
+ return;
324
+ }
325
+ if (Module.errorHandler && Module.errorHandler(message, filename, lineno))
326
+ return;
327
+ console.log("Invoking error handler due to\n" + message);
328
+
329
+ // Support Firefox window.dump functionality.
330
+ if (typeof dump == "function")
331
+ dump("Invoking error handler due to\n" + message);
332
+
333
+ if (errorHandler.didShowErrorMessage)
334
+ return;
335
+ var message = "An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n" + message;
336
+ if (message.indexOf("DISABLE_EXCEPTION_CATCHING") != -1) {
337
+ message = "An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.";
338
+ } else if (message.indexOf("Cannot enlarge memory arrays") != -1) {
339
+ message = "Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.";
340
+ } else if (message.indexOf("Invalid array buffer length") != -1 || message.indexOf("Invalid typed array length") != -1 || message.indexOf("out of memory") != -1 || message.indexOf("could not allocate memory") != -1) {
341
+ message = "The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings.";
342
+ }
343
+ alert(message);
344
+ errorHandler.didShowErrorMessage = true;
345
+ }
346
+
347
+
348
+ Module.abortHandler = function (message) {
349
+ errorHandler(message, "", 0);
350
+ return true;
351
+ };
352
+
353
+ Error.stackTraceLimit = Math.max(Error.stackTraceLimit || 0, 50);
354
+
355
+ function progressUpdate(id, e) {
356
+ if (id == "symbolsUrl")
357
+ return;
358
+ var progress = Module.downloadProgress[id];
359
+ if (!progress)
360
+ progress = Module.downloadProgress[id] = {
361
+ started: false,
362
+ finished: false,
363
+ lengthComputable: false,
364
+ total: 0,
365
+ loaded: 0,
366
+ };
367
+ if (typeof e == "object" && (e.type == "progress" || e.type == "load")) {
368
+ if (!progress.started) {
369
+ progress.started = true;
370
+ progress.lengthComputable = e.lengthComputable;
371
+ }
372
+ progress.total = e.total;
373
+ progress.loaded = e.loaded;
374
+ if (e.type == "load")
375
+ progress.finished = true;
376
+ }
377
+ var loaded = 0, total = 0, started = 0, computable = 0, unfinishedNonComputable = 0;
378
+ for (var id in Module.downloadProgress) {
379
+ var progress = Module.downloadProgress[id];
380
+ if (!progress.started)
381
+ return 0;
382
+ started++;
383
+ if (progress.lengthComputable) {
384
+ loaded += progress.loaded;
385
+ total += progress.total;
386
+ computable++;
387
+ } else if (!progress.finished) {
388
+ unfinishedNonComputable++;
389
+ }
390
+ }
391
+ var totalProgress = started ? (started - unfinishedNonComputable - (total ? computable * (total - loaded) / total : 0)) / started : 0;
392
+ onProgress(0.9 * totalProgress);
393
+ }
394
+
395
+ Module.readBodyWithProgress = function() {
396
+ /**
397
+ * Estimate length of uncompressed content by taking average compression ratios
398
+ * of compression type into account.
399
+ * @param {Response} response A Fetch API response object
400
+ * @param {boolean} lengthComputable Return wether content length was given in header.
401
+ * @returns {number}
402
+ */
403
+ function estimateContentLength(response, lengthComputable) {
404
+ if (!lengthComputable) {
405
+ // No content length available
406
+ return 0;
407
+ }
408
+
409
+ var compression = response.headers.get("Content-Encoding");
410
+ var contentLength = parseInt(response.headers.get("Content-Length"));
411
+
412
+ switch (compression) {
413
+ case "br":
414
+ return Math.round(contentLength * 5);
415
+ case "gzip":
416
+ return Math.round(contentLength * 4);
417
+ default:
418
+ return contentLength;
419
+ }
420
+ }
421
+
422
+ function readBodyWithProgress(response, onProgress, enableStreaming) {
423
+ var reader = response.body ? response.body.getReader() : undefined;
424
+ var lengthComputable = typeof response.headers.get('Content-Length') !== "undefined";
425
+ var estimatedContentLength = estimateContentLength(response, lengthComputable);
426
+ var body = new Uint8Array(estimatedContentLength);
427
+ var trailingChunks = [];
428
+ var receivedLength = 0;
429
+ var trailingChunksStart = 0;
430
+
431
+ if (!lengthComputable) {
432
+ console.warn("[UnityCache] Response is served without Content-Length header. Please reconfigure server to include valid Content-Length for better download performance.");
433
+ }
434
+
435
+ function readBody() {
436
+ if (typeof reader === "undefined") {
437
+ // Browser does not support streaming reader API
438
+ // Fallback to Respone.arrayBuffer()
439
+ return response.arrayBuffer().then(function (buffer) {
440
+ var body = new Uint8Array(buffer);
441
+ onProgress({
442
+ type: "progress",
443
+ response: response,
444
+ total: buffer.length,
445
+ loaded: 0,
446
+ lengthComputable: lengthComputable,
447
+ chunk: enableStreaming ? body : null
448
+ });
449
+
450
+ return body;
451
+ });
452
+ }
453
+
454
+ // Start reading memory chunks
455
+ return reader.read().then(function (result) {
456
+ if (result.done) {
457
+ return concatenateTrailingChunks();
458
+ }
459
+
460
+ if ((receivedLength + result.value.length) <= body.length) {
461
+ // Directly append chunk to body if enough memory was allocated
462
+ body.set(result.value, receivedLength);
463
+ trailingChunksStart = receivedLength + result.value.length;
464
+ } else {
465
+ // Store additional chunks in array to append later
466
+ trailingChunks.push(result.value);
467
+ }
468
+
469
+ receivedLength += result.value.length;
470
+ onProgress({
471
+ type: "progress",
472
+ response: response,
473
+ total: Math.max(estimatedContentLength, receivedLength),
474
+ loaded: receivedLength,
475
+ lengthComputable: lengthComputable,
476
+ chunk: enableStreaming ? result.value : null
477
+ });
478
+
479
+ return readBody();
480
+ });
481
+ }
482
+
483
+ function concatenateTrailingChunks() {
484
+ if (receivedLength === estimatedContentLength) {
485
+ return body;
486
+ }
487
+
488
+ if (receivedLength < estimatedContentLength) {
489
+ // Less data received than estimated, shrink body
490
+ return body.slice(0, receivedLength);
491
+ }
492
+
493
+ // More data received than estimated, create new larger body to prepend all additional chunks to the body
494
+ var newBody = new Uint8Array(receivedLength);
495
+ newBody.set(body, 0);
496
+ var position = trailingChunksStart;
497
+ for (var i = 0; i < trailingChunks.length; ++i) {
498
+ newBody.set(trailingChunks[i], position);
499
+ position += trailingChunks[i].length;
500
+ }
501
+
502
+ return newBody;
503
+ }
504
+
505
+ return readBody().then(function (parsedBody) {
506
+ onProgress({
507
+ type: "load",
508
+ response: response,
509
+ total: parsedBody.length,
510
+ loaded: parsedBody.length,
511
+ lengthComputable: lengthComputable,
512
+ chunk: null
513
+ });
514
+
515
+ response.parsedBody = parsedBody;
516
+ return response;
517
+ });
518
+ }
519
+
520
+ return readBodyWithProgress;
521
+ }();
522
+
523
+ Module.fetchWithProgress = function () {
524
+ function fetchWithProgress(resource, init) {
525
+ var onProgress = function () { };
526
+ if (init && init.onProgress) {
527
+ onProgress = init.onProgress;
528
+ }
529
+
530
+ return fetch(resource, init).then(function (response) {
531
+ return Module.readBodyWithProgress(response, onProgress, init.enableStreamingDownload);
532
+ });
533
+ }
534
+
535
+ return fetchWithProgress;
536
+ }();
537
+
538
+ /**
539
+ * @interface RequestMetaData
540
+ * An object with meta data for a request
541
+ *
542
+ * @property {string} url The url of a request
543
+ * @property {string} company The company name
544
+ * @property {string} product The product name
545
+ * @property {number} version The version of the build
546
+ * @property {number} size The company of the build
547
+ * @property {number} accessedAt Timestamp when request was last accessed (Unix timestamp format)
548
+ * @property {number} updatedAt Timestamp when request was last updated in the cache (Unix timestamp format)
549
+ */
550
+
551
+ /**
552
+ * @interface ResponseWithMetaData
553
+ * An object with a cached response and meta data
554
+ * @property {Response} response
555
+ * @property {RequestMetaData} metaData
556
+ */
557
+
558
+ Module.UnityCache = function () {
559
+ var UnityCacheDatabase = { name: "UnityCache", version: 4 };
560
+ var RequestMetaDataStore = { name: "RequestMetaDataStore", version: 1 };
561
+ var RequestStore = { name: "RequestStore", version: 1 };
562
+ var WebAssemblyStore = { name: "WebAssembly", version: 1 };
563
+ var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
564
+
565
+ function log(message) {
566
+ console.log("[UnityCache] " + message);
567
+ }
568
+
569
+ /**
570
+ * A request cache that uses the browser Index DB to cache large requests
571
+ * @property {Promise<void>} isConnected
572
+ * @property {Cache} cache
573
+ */
574
+ function UnityCache() {
575
+ var self = this;
576
+
577
+ this.isConnected = this.connect().then(function () {
578
+ return self.cleanUpCache();
579
+ });
580
+
581
+ this.isConnected.catch(function (error) {
582
+ log("Error when initializing cache: " + error);
583
+ });
584
+ }
585
+
586
+ var instance = null;
587
+ /**
588
+ * Singleton accessor. Returns unity cache instance
589
+ * @returns {UnityCache}
590
+ */
591
+ UnityCache.getInstance = function () {
592
+ if (!instance) {
593
+ instance = new UnityCache();
594
+ }
595
+
596
+ return instance;
597
+ }
598
+
599
+ /**
600
+ * Destroy unity cache instance. Returns a promise that waits for the
601
+ * database connection to be closed.
602
+ * @returns {Promise<void>}
603
+ */
604
+ UnityCache.destroyInstance = function () {
605
+ if (!instance) {
606
+ return Promise.resolve();
607
+ }
608
+
609
+ return instance.close().then(function () {
610
+ instance = null;
611
+ });
612
+ }
613
+
614
+ /**
615
+ * Clear the unity cache.
616
+ * @returns {Promise<void>} A promise that resolves when the cache is cleared.
617
+ */
618
+ UnityCache.prototype.clearCache = function () {
619
+ var self = this;
620
+
621
+ function deleteCacheEntries(cacheKeys) {
622
+ if (cacheKeys.length === 0) {
623
+ return Promise.resolve();
624
+ }
625
+
626
+ var key = cacheKeys.pop();
627
+
628
+ return self.cache.delete(key).then(function () {
629
+ return deleteCacheEntries(cacheKeys);
630
+ });
631
+ }
632
+
633
+ return this.isConnected.then(function () {
634
+ return self.execute(RequestMetaDataStore.name, "clear", []);
635
+ }).then(function () {
636
+ return self.cache.keys();
637
+ }).then(function (keys) {
638
+ return deleteCacheEntries(keys)
639
+ });
640
+ }
641
+
642
+ /**
643
+ * Config for request meta data store
644
+ */
645
+ UnityCache.UnityCacheDatabase = UnityCacheDatabase;
646
+ UnityCache.RequestMetaDataStore = RequestMetaDataStore;
647
+ UnityCache.MaximumCacheSize = 1024 * 1024 * 1024; // 1 GB
648
+
649
+ /**
650
+ * Load a request response from cache
651
+ * @param {Request|string} request The fetch request
652
+ * @returns {Promise<ResponseWithMetaData|undefined>} A cached response with meta data for the request or undefined if request is not in cache.
653
+ */
654
+ UnityCache.prototype.loadRequest = function (request) {
655
+ var self = this;
656
+
657
+ return self.isConnected.then(function () {
658
+ return Promise.all([
659
+ self.cache.match(request),
660
+ self.loadRequestMetaData(request)
661
+ ]);
662
+ }).then(function (result) {
663
+ if (typeof result[0] === "undefined" || typeof result[1] === "undefined") {
664
+ return undefined;
665
+ }
666
+
667
+ return {
668
+ response: result[0],
669
+ metaData: result[1]
670
+ };
671
+ });
672
+ }
673
+
674
+ /**
675
+ * Load a request meta data from cache
676
+ * @param {Request|string} request The fetch request
677
+ * @returns {Promise<RequestMetaData>} Request meta data
678
+ */
679
+ UnityCache.prototype.loadRequestMetaData = function (request) {
680
+ var url = typeof request === "string" ? request : request.url;
681
+
682
+ return this.execute(RequestMetaDataStore.name, "get", [url]);
683
+ }
684
+
685
+ /**
686
+ * Update meta data of a request
687
+ * @param {RequestMetaData} metaData
688
+ * @returns {Promise<void>}
689
+ */
690
+ UnityCache.prototype.updateRequestMetaData = function (metaData) {
691
+ return this.execute(RequestMetaDataStore.name, "put", [metaData]);
692
+ }
693
+
694
+ /**
695
+ * Store request in cache
696
+ * @param {Request} request
697
+ * @param {Response} response
698
+ * @returns {Promise<void>}
699
+ */
700
+ UnityCache.prototype.storeRequest = function (request, response) {
701
+ var self = this;
702
+
703
+ return self.isConnected.then(function () {
704
+ return self.cache.put(request, response);
705
+ });
706
+ }
707
+
708
+ /**
709
+ * Close database and cache connection.
710
+ * @async
711
+ */
712
+ UnityCache.prototype.close = function () {
713
+ return this.isConnected.then(function () {
714
+ if (this.database) {
715
+ this.database.close();
716
+ this.database = null;
717
+ }
718
+
719
+ if (this.cache) {
720
+ this.cache = null;
721
+ }
722
+
723
+ }.bind(this));
724
+ }
725
+
726
+
727
+ /**
728
+ * Create a connection to Cache and IndexedDB for meta data storage
729
+ * @private
730
+ * @async
731
+ * @returns {Promise<void>} A Promise that is resolved when a connection to the IndexedDB and cache are established.
732
+ */
733
+ UnityCache.prototype.connect = function () {
734
+ var self = this;
735
+
736
+ if (typeof indexedDB === "undefined") {
737
+ return Promise.reject(new Error("Could not connect to cache: IndexedDB is not supported."));
738
+ }
739
+
740
+ if (typeof window.caches === "undefined") {
741
+ return Promise.reject(new Error("Could not connect to cache: Cache API is not supported."));
742
+ }
743
+
744
+ var isConnected = new Promise(function (resolve, reject) {
745
+ try {
746
+ // Workaround for WebKit bug 226547:
747
+ // On very first page load opening a connection to IndexedDB hangs without triggering onerror.
748
+ // Add a timeout that triggers the error handling code.
749
+ self.openDBTimeout = setTimeout(function () {
750
+ if (typeof self.database != "undefined") {
751
+ return;
752
+ }
753
+
754
+ reject(new Error("Could not connect to cache: Database timeout."));
755
+ }, 20000);
756
+
757
+ function clearOpenDBTimeout() {
758
+ if (!self.openDBTimeout) {
759
+ return;
760
+ }
761
+
762
+ clearTimeout(self.openDBTimeout);
763
+ self.openDBTimeout = null;
764
+ }
765
+
766
+ var openRequest = indexedDB.open(UnityCacheDatabase.name, UnityCacheDatabase.version);
767
+
768
+ openRequest.onupgradeneeded = self.upgradeDatabase.bind(self);
769
+
770
+ openRequest.onsuccess = function (e) {
771
+ clearOpenDBTimeout();
772
+ self.database = e.target.result;
773
+ resolve();
774
+ };
775
+
776
+ openRequest.onerror = function (error) {
777
+ clearOpenDBTimeout();
778
+ self.database = null;
779
+ reject(new Error("Could not connect to database."));
780
+ };
781
+ } catch (error) {
782
+ clearOpenDBTimeout();
783
+ self.database = null;
784
+ self.cache = null;
785
+ reject(new Error("Could not connect to cache: Could not connect to database."));
786
+ }
787
+ }).then(function () {
788
+ var cacheName = UnityCacheDatabase.name + "_" + Module.companyName + "_" + Module.productName;
789
+
790
+ return caches.open(cacheName);
791
+ }).then(function (cache) {
792
+ self.cache = cache;
793
+ });
794
+
795
+ return isConnected;
796
+ }
797
+
798
+ /**
799
+ * Upgrade object store if database is outdated
800
+ * @private
801
+ * @param {any} e Database upgrade event
802
+ */
803
+ UnityCache.prototype.upgradeDatabase = function (e) {
804
+ var database = e.target.result;
805
+
806
+ if (!database.objectStoreNames.contains(RequestMetaDataStore.name)) {
807
+ var objectStore = database.createObjectStore(RequestMetaDataStore.name, { keyPath: "url" });
808
+ ["accessedAt", "updatedAt"].forEach(function (index) { objectStore.createIndex(index, index); });
809
+ }
810
+
811
+ if (database.objectStoreNames.contains(RequestStore.name)) {
812
+ database.deleteObjectStore(RequestStore.name);
813
+ }
814
+
815
+ if (database.objectStoreNames.contains(WebAssemblyStore.name)) {
816
+ database.deleteObjectStore(WebAssemblyStore.name);
817
+ }
818
+ }
819
+
820
+ /**
821
+ * Execute an operation on the cache
822
+ * @private
823
+ * @param {string} store The name of the store to use
824
+ * @param {string} operation The operation to to execute on the cache
825
+ * @param {Array} parameters Parameters for the operation
826
+ * @returns {Promise} A promise to the cache entry
827
+ */
828
+ UnityCache.prototype.execute = function (store, operation, parameters) {
829
+ return this.isConnected.then(function () {
830
+ return new Promise(function (resolve, reject) {
831
+ try {
832
+ // Failure during initialization of database -> reject Promise
833
+ if (this.database === null) {
834
+ reject(new Error("indexedDB access denied"))
835
+ return;
836
+ }
837
+
838
+ // Create a transaction for the request
839
+ var accessMode = ["put", "delete", "clear"].indexOf(operation) != -1 ? "readwrite" : "readonly";
840
+ var transaction = this.database.transaction([store], accessMode)
841
+ var target = transaction.objectStore(store);
842
+ if (operation == "openKeyCursor") {
843
+ target = target.index(parameters[0]);
844
+ parameters = parameters.slice(1);
845
+ }
846
+
847
+ // Make a request to the database
848
+ var request = target[operation].apply(target, parameters);
849
+ request.onsuccess = function (e) {
850
+ resolve(e.target.result);
851
+ };
852
+ request.onerror = function (error) {
853
+ reject(error);
854
+ };
855
+ } catch (error) {
856
+ reject(error);
857
+ }
858
+ }.bind(this));
859
+ }.bind(this));
860
+ }
861
+
862
+ UnityCache.prototype.getMetaDataEntries = function () {
863
+ var self = this;
864
+ var cacheSize = 0;
865
+ var metaDataEntries = [];
866
+
867
+ return new Promise(function (resolve, reject) {
868
+ var transaction = self.database.transaction([RequestMetaDataStore.name], "readonly");
869
+ var target = transaction.objectStore(RequestMetaDataStore.name);
870
+ var request = target.openCursor();
871
+
872
+ request.onsuccess = function (event) {
873
+ var cursor = event.target.result;
874
+
875
+ if (cursor) {
876
+ cacheSize += cursor.value.size;
877
+ metaDataEntries.push(cursor.value);
878
+
879
+ cursor.continue();
880
+ } else {
881
+ resolve({
882
+ metaDataEntries: metaDataEntries,
883
+ cacheSize: cacheSize
884
+ });
885
+ }
886
+ };
887
+ request.onerror = function (error) {
888
+ reject(error);
889
+ };
890
+ });
891
+ }
892
+
893
+ /**
894
+ * Clean up cache by removing outdated entries.
895
+ * @private
896
+ * @returns {Promise<void>}
897
+ */
898
+ UnityCache.prototype.cleanUpCache = function () {
899
+ var self = this;
900
+
901
+ return this.getMetaDataEntries().then(function (result) {
902
+ var metaDataEntries = result.metaDataEntries;
903
+ var cacheSize = result.cacheSize;
904
+ var entriesToDelete = [];
905
+ var newMetaDataEntries = [];
906
+
907
+ // Remove cached entries with outdated product version
908
+ for (var i = 0; i < metaDataEntries.length; ++i) {
909
+ if (metaDataEntries[i].version == Module.productVersion) {
910
+ newMetaDataEntries.push(metaDataEntries[i]);
911
+ continue;
912
+ }
913
+
914
+ entriesToDelete.push(metaDataEntries[i]);
915
+ cacheSize -= metaDataEntries[i].size;
916
+ }
917
+
918
+ // Remove cache entries until cache size limit is met
919
+ newMetaDataEntries.sort(function (a,b) {
920
+ return a.accessedAt - b.accessedAt;
921
+ });
922
+
923
+ for (var i = 0; i < newMetaDataEntries.length; ++i) {
924
+ if (cacheSize < UnityCache.MaximumCacheSize) {
925
+ break;
926
+ }
927
+
928
+ entriesToDelete.push(newMetaDataEntries[i]);
929
+ cacheSize -= newMetaDataEntries[i].size;
930
+ }
931
+
932
+ function deleteMetaDataEntry(url) {
933
+ return new Promise(function (resolve, reject) {
934
+ var transaction = self.database.transaction([RequestMetaDataStore.name], "readwrite");
935
+ var target = transaction.objectStore(RequestMetaDataStore.name);
936
+ target.delete(url);
937
+
938
+ transaction.oncomplete = resolve;
939
+ transaction.onerror = reject;
940
+ });
941
+ }
942
+
943
+ function deleteEntries() {
944
+ if (entriesToDelete.length === 0) {
945
+ return Promise.resolve();
946
+ }
947
+
948
+ var entryToDelete = entriesToDelete.pop();
949
+ return self.cache.delete(entryToDelete.url).then(function (deleted) {
950
+ if (deleted) {
951
+ return deleteMetaDataEntry(entryToDelete.url);
952
+ }
953
+ }).then(function () {
954
+ return deleteEntries();
955
+ });
956
+ }
957
+
958
+ return deleteEntries();
959
+ });
960
+ }
961
+
962
+ return UnityCache;
963
+ }();
964
+ Module.cachedFetch = function () {
965
+ var UnityCache = Module.UnityCache;
966
+ var fetchWithProgress = Module.fetchWithProgress;
967
+ var readBodyWithProgress = Module.readBodyWithProgress;
968
+
969
+ function log(message) {
970
+ console.log("[UnityCache] " + message);
971
+ }
972
+
973
+ function resolveURL(url) {
974
+ resolveURL.link = resolveURL.link || document.createElement("a");
975
+ resolveURL.link.href = url;
976
+ return resolveURL.link.href;
977
+ }
978
+
979
+ function isCrossOriginURL(url) {
980
+ var originMatch = window.location.href.match(/^[a-z]+:\/\/[^\/]+/);
981
+ return !originMatch || url.lastIndexOf(originMatch[0], 0);
982
+ }
983
+
984
+ function isCacheEnabled(url, init) {
985
+ if (init && init.method && init.method !== "GET") {
986
+ return false;
987
+ }
988
+
989
+ if (init && ["must-revalidate", "immutable"].indexOf(init.control) == -1) {
990
+ return false;
991
+ }
992
+
993
+ if (!url.match("^https?:\/\/")) {
994
+ return false;
995
+ }
996
+
997
+ return true;
998
+ }
999
+
1000
+ function cachedFetch(resource, init) {
1001
+ var unityCache = UnityCache.getInstance();
1002
+ var url = resolveURL((typeof resource === "string") ? resource : resource.url);
1003
+ var cache = { enabled: isCacheEnabled(url, init) };
1004
+ if (init) {
1005
+ cache.control = init.control;
1006
+ cache.companyName = init.companyName;
1007
+ cache.productName = init.productName;
1008
+ cache.productVersion = init.productVersion;
1009
+ }
1010
+ cache.revalidated = false;
1011
+ cache.metaData = {
1012
+ url: url,
1013
+ accessedAt: Date.now(),
1014
+ version: cache.productVersion
1015
+ };
1016
+ cache.response = null;
1017
+
1018
+ function fetchAndStoreInCache(resource, init) {
1019
+ return fetch(resource, init).then(function (response) {
1020
+ if (!cache.enabled || cache.revalidated) {
1021
+ return response;
1022
+ }
1023
+
1024
+ if (response.status === 304) {
1025
+ // Cached response is still valid. Set revalidated flag and return cached response
1026
+ cache.revalidated = true;
1027
+
1028
+ unityCache.updateRequestMetaData(cache.metaData).then(function () {
1029
+ log("'" + cache.metaData.url + "' successfully revalidated and served from the indexedDB cache");
1030
+ }).catch(function (error) {
1031
+ log("'" + cache.metaData.url + "' successfully revalidated but not stored in the indexedDB cache due to the error: " + error);
1032
+ });
1033
+
1034
+ return readBodyWithProgress(cache.response, init.onProgress, init.enableStreamingDownload);
1035
+ } else if (response.status == 200) {
1036
+ // New response -> Store it and cache and return it
1037
+ cache.response = response;
1038
+ cache.metaData.updatedAt = cache.metaData.accessedAt;
1039
+ cache.revalidated = true;
1040
+ var clonedResponse = response.clone();
1041
+
1042
+ return readBodyWithProgress(response, init.onProgress, init.enableStreamingDownload).then(function (response) {
1043
+ // Update cached request and meta data
1044
+ cache.metaData.size = response.parsedBody.length;
1045
+ Promise.all([
1046
+ unityCache.storeRequest(resource, clonedResponse),
1047
+ unityCache.updateRequestMetaData(cache.metaData)
1048
+ ]).then(function () {
1049
+ log("'" + url + "' successfully downloaded and stored in the indexedDB cache");
1050
+ }).catch(function (error) {
1051
+ log("'" + url + "' successfully downloaded but not stored in the indexedDB cache due to the error: " + error);
1052
+ });
1053
+
1054
+ return response;
1055
+ });
1056
+ } else {
1057
+ // Request failed
1058
+ log("'" + url + "' request failed with status: " + response.status + " " + response.statusText);
1059
+ }
1060
+
1061
+ return readBodyWithProgress(response, init.onProgress, init.enableStreamingDownload);
1062
+ });
1063
+ }
1064
+
1065
+ // Use fetch directly if request can't be cached
1066
+ if (!cache.enabled) {
1067
+ return fetchWithProgress(resource, init);
1068
+ }
1069
+
1070
+ return unityCache.loadRequest(url).then(function (result) {
1071
+ // Fetch resource and store it in cache if not present or outdated version
1072
+ if (!result) {
1073
+ return fetchAndStoreInCache(resource, init);
1074
+ }
1075
+
1076
+ var response = result.response;
1077
+ var metaData = result.metaData;
1078
+ cache.response = response;
1079
+ cache.metaData.size = metaData.size;
1080
+ cache.metaData.updatedAt = metaData.updatedAt;
1081
+
1082
+ if (cache.control == "immutable") {
1083
+ cache.revalidated = true;
1084
+ unityCache.updateRequestMetaData(metaData).then(function () {
1085
+ log("'" + cache.metaData.url + "' served from the indexedDB cache without revalidation");
1086
+ });
1087
+
1088
+ return readBodyWithProgress(response, init.onProgress, init.enableStreamingDownload);
1089
+ } else if (isCrossOriginURL(url) && (response.headers.get("Last-Modified") || response.headers.get("ETag"))) {
1090
+ return fetch(url, { method: "HEAD" }).then(function (headResult) {
1091
+ cache.revalidated = ["Last-Modified", "ETag"].every(function (header) {
1092
+ return !response.headers.get(header) || response.headers.get(header) == headResult.headers.get(header);
1093
+ });
1094
+ if (cache.revalidated) {
1095
+ unityCache.updateRequestMetaData(metaData).then(function () {
1096
+ log("'" + cache.metaData.url + "' successfully revalidated and served from the indexedDB cache");
1097
+ });
1098
+
1099
+ return readBodyWithProgress(cache.response, init.onProgress, init.enableStreamingDownload);
1100
+ } else {
1101
+ return fetchAndStoreInCache(resource, init);
1102
+ }
1103
+ });
1104
+ } else {
1105
+ init = init || {};
1106
+ var requestHeaders = init.headers || {};
1107
+ init.headers = requestHeaders;
1108
+ if (response.headers.get("Last-Modified")) {
1109
+ requestHeaders["If-Modified-Since"] = response.headers.get("Last-Modified");
1110
+ requestHeaders["Cache-Control"] = "no-cache";
1111
+ } else if (response.headers.get("ETag")) {
1112
+ requestHeaders["If-None-Match"] = response.headers.get("ETag");
1113
+ requestHeaders["Cache-Control"] = "no-cache";
1114
+ }
1115
+
1116
+ return fetchAndStoreInCache(resource, init);
1117
+ }
1118
+ }).catch(function (error) {
1119
+ // Fallback to regular fetch if and IndexDB error occurs
1120
+ log("Failed to load '" + cache.metaData.url + "' from indexedDB cache due to the error: " + error);
1121
+ return fetchWithProgress(resource, init);
1122
+ });
1123
+ }
1124
+
1125
+ return cachedFetch;
1126
+ }();
1127
+
1128
+
1129
+ function downloadBinary(urlId) {
1130
+ progressUpdate(urlId);
1131
+ var cacheControl = Module.cacheControl(Module[urlId]);
1132
+ var fetchImpl = Module.companyName && Module.productName ? Module.cachedFetch : Module.fetchWithProgress;
1133
+ var url = Module[urlId];
1134
+ var mode = /file:\/\//.exec(url) ? "same-origin" : undefined;
1135
+
1136
+ var request = fetchImpl(Module[urlId], {
1137
+ method: "GET",
1138
+ companyName: Module.companyName,
1139
+ productName: Module.productName,
1140
+ productVersion: Module.productVersion,
1141
+ control: cacheControl,
1142
+ mode: mode,
1143
+ onProgress: function (event) {
1144
+ progressUpdate(urlId, event);
1145
+ }
1146
+ });
1147
+
1148
+ return request.then(function (response) {
1149
+ return response.parsedBody;
1150
+ }).catch(function (e) {
1151
+ var error = 'Failed to download file ' + Module[urlId];
1152
+ if (location.protocol == 'file:') {
1153
+ showBanner(error + '. Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host Unity content, or use the Unity Build and Run option.', 'error');
1154
+ } else {
1155
+ console.error(error);
1156
+ }
1157
+ });
1158
+ }
1159
+
1160
+ function downloadFramework() {
1161
+ return new Promise(function (resolve, reject) {
1162
+ var script = document.createElement("script");
1163
+ script.src = Module.frameworkUrl;
1164
+ script.onload = function () {
1165
+ // Adding the framework.js script to DOM created a global
1166
+ // 'unityFramework' variable that should be considered internal.
1167
+ // If not, then we have received a malformed file.
1168
+ if (typeof unityFramework === 'undefined' || !unityFramework) {
1169
+ var compressions = [['br', 'br'], ['gz', 'gzip']];
1170
+ for(var i in compressions) {
1171
+ var compression = compressions[i];
1172
+ if (Module.frameworkUrl.endsWith('.' + compression[0])) {
1173
+ var error = 'Unable to parse ' + Module.frameworkUrl + '!';
1174
+ if (location.protocol == 'file:') {
1175
+ showBanner(error + ' Loading pre-compressed (brotli or gzip) content via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host compressed Unity content, or use the Unity Build and Run option.', 'error');
1176
+ return;
1177
+ }
1178
+ error += ' This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: ' + compression[1] + '" present. Check browser Console and Devtools Network tab to debug.';
1179
+ if (compression[0] == 'br') {
1180
+ if (location.protocol == 'http:') {
1181
+ var migrationHelp = ['localhost', '127.0.0.1'].indexOf(location.hostname) != -1 ? '' : 'Migrate your server to use HTTPS.'
1182
+ if (/Firefox/.test(navigator.userAgent)) error = 'Unable to parse ' + Module.frameworkUrl + '!<br>If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported in Firefox over HTTP connections. ' + migrationHelp + ' See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1670675">https://bugzilla.mozilla.org/show_bug.cgi?id=1670675</a> for more information.';
1183
+ else error = 'Unable to parse ' + Module.frameworkUrl + '!<br>If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported over HTTP connections. Migrate your server to use HTTPS.';
1184
+ }
1185
+ }
1186
+ showBanner(error, 'error');
1187
+ return;
1188
+ }
1189
+ };
1190
+ showBanner('Unable to parse ' + Module.frameworkUrl + '! The file is corrupt, or compression was misconfigured? (check Content-Encoding HTTP Response Header on web server)', 'error');
1191
+ }
1192
+
1193
+ // Capture the variable to local scope and clear it from global
1194
+ // scope so that JS garbage collection can take place on
1195
+ // application quit.
1196
+ var fw = unityFramework;
1197
+ unityFramework = null;
1198
+ // Also ensure this function will not hold any JS scope
1199
+ // references to prevent JS garbage collection.
1200
+ script.onload = null;
1201
+ resolve(fw);
1202
+ }
1203
+ script.onerror = function(e) {
1204
+ showBanner('Unable to load file ' + Module.frameworkUrl + '! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)', 'error');
1205
+ }
1206
+ document.body.appendChild(script);
1207
+ Module.deinitializers.push(function() {
1208
+ document.body.removeChild(script);
1209
+ });
1210
+ });
1211
+ }
1212
+
1213
+ function loadBuild() {
1214
+ downloadFramework().then(function (unityFramework) {
1215
+ unityFramework(Module);
1216
+ });
1217
+
1218
+ var dataPromise = downloadBinary("dataUrl");
1219
+ Module.preRun.push(function () {
1220
+ Module.addRunDependency("dataUrl");
1221
+ dataPromise.then(function (data) {
1222
+ var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
1223
+ var pos = 0;
1224
+ var prefix = "UnityWebData1.0\0";
1225
+ if (!String.fromCharCode.apply(null, data.subarray(pos, pos + prefix.length)) == prefix)
1226
+ throw "unknown data format";
1227
+ pos += prefix.length;
1228
+ var headerSize = view.getUint32(pos, true); pos += 4;
1229
+ while (pos < headerSize) {
1230
+ var offset = view.getUint32(pos, true); pos += 4;
1231
+ var size = view.getUint32(pos, true); pos += 4;
1232
+ var pathLength = view.getUint32(pos, true); pos += 4;
1233
+ var path = String.fromCharCode.apply(null, data.subarray(pos, pos + pathLength)); pos += pathLength;
1234
+ for (var folder = 0, folderNext = path.indexOf("/", folder) + 1 ; folderNext > 0; folder = folderNext, folderNext = path.indexOf("/", folder) + 1)
1235
+ Module.FS_createPath(path.substring(0, folder), path.substring(folder, folderNext - 1), true, true);
1236
+ Module.FS_createDataFile(path, null, data.subarray(offset, offset + size), true, true, true);
1237
+ }
1238
+ Module.removeRunDependency("dataUrl");
1239
+ });
1240
+ });
1241
+ }
1242
+
1243
+ return new Promise(function (resolve, reject) {
1244
+ if (!Module.SystemInfo.hasWebGL) {
1245
+ reject("Your browser does not support WebGL.");
1246
+ } else if (Module.SystemInfo.hasWebGL == 1) {
1247
+ var msg = "Your browser does not support graphics API \"WebGL 2\" which is required for this content.";
1248
+ if (Module.SystemInfo.browser == 'Safari' && parseInt(Module.SystemInfo.browserVersion) < 15) {
1249
+ if (Module.SystemInfo.mobile || navigator.maxTouchPoints > 1)
1250
+ msg += "\nUpgrade to iOS 15 or later.";
1251
+ else
1252
+ msg += "\nUpgrade to Safari 15 or later.";
1253
+ }
1254
+ reject(msg);
1255
+ } else if (!Module.SystemInfo.hasWasm) {
1256
+ reject("Your browser does not support WebAssembly.");
1257
+ } else {
1258
+ Module.startupErrorHandler = reject;
1259
+ onProgress(0);
1260
+ Module.postRun.push(function () {
1261
+ onProgress(1);
1262
+ delete Module.startupErrorHandler;
1263
+ resolve(unityInstance);
1264
+ });
1265
+ loadBuild();
1266
+ }
1267
+ });
1268
+ }
Build/202405050231.wasm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:842d2462ba73f74371a50ae3bc7616ab8e0260c48c3b23d329df69be588de515
3
+ size 102932437
StreamingAssets/aa/AddressablesLink/link.xml CHANGED
@@ -1,35 +1,35 @@
1
- <linker>
2
- <assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
3
- <type fullname="AddressableLabelsSO" preserve="all" />
4
- </assembly>
5
- <assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
6
- <type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
7
- </assembly>
8
- <assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
9
- <type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
10
- <type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
11
- <type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
12
- <type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
13
- <type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
14
- </assembly>
15
- <assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
16
- <type fullname="UnityEngine.GameObject" preserve="all" />
17
- <type fullname="UnityEngine.Material" preserve="all" />
18
- <type fullname="UnityEngine.Mesh" preserve="all" />
19
- <type fullname="UnityEngine.MeshFilter" preserve="all" />
20
- <type fullname="UnityEngine.MeshRenderer" preserve="all" />
21
- <type fullname="UnityEngine.Object" preserve="all" />
22
- <type fullname="UnityEngine.Shader" preserve="all" />
23
- <type fullname="UnityEngine.Texture2D" preserve="all" />
24
- <type fullname="UnityEngine.Transform" preserve="all" />
25
- </assembly>
26
- <assembly fullname="UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
27
- <type fullname="UnityEngine.ParticleSystem" preserve="all" />
28
- <type fullname="UnityEngine.ParticleSystemRenderer" preserve="all" />
29
- </assembly>
30
- <assembly fullname="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
31
- <type fullname="UnityEngine.BoxCollider" preserve="all" />
32
- <type fullname="UnityEngine.CapsuleCollider" preserve="all" />
33
- <type fullname="UnityEngine.MeshCollider" preserve="all" />
34
- </assembly>
35
  </linker>
 
1
+ <linker>
2
+ <assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
3
+ <type fullname="AddressableLabelsSO" preserve="all" />
4
+ </assembly>
5
+ <assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
6
+ <type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
7
+ </assembly>
8
+ <assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
9
+ <type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
10
+ <type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
11
+ <type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
12
+ <type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
13
+ <type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
14
+ </assembly>
15
+ <assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
16
+ <type fullname="UnityEngine.GameObject" preserve="all" />
17
+ <type fullname="UnityEngine.Material" preserve="all" />
18
+ <type fullname="UnityEngine.Mesh" preserve="all" />
19
+ <type fullname="UnityEngine.MeshFilter" preserve="all" />
20
+ <type fullname="UnityEngine.MeshRenderer" preserve="all" />
21
+ <type fullname="UnityEngine.Object" preserve="all" />
22
+ <type fullname="UnityEngine.Shader" preserve="all" />
23
+ <type fullname="UnityEngine.Texture2D" preserve="all" />
24
+ <type fullname="UnityEngine.Transform" preserve="all" />
25
+ </assembly>
26
+ <assembly fullname="UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
27
+ <type fullname="UnityEngine.ParticleSystem" preserve="all" />
28
+ <type fullname="UnityEngine.ParticleSystemRenderer" preserve="all" />
29
+ </assembly>
30
+ <assembly fullname="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
31
+ <type fullname="UnityEngine.BoxCollider" preserve="all" />
32
+ <type fullname="UnityEngine.CapsuleCollider" preserve="all" />
33
+ <type fullname="UnityEngine.MeshCollider" preserve="all" />
34
+ </assembly>
35
  </linker>
StreamingAssets/aa/WebGL/defaultlocalgroup_assets_all_2d5a392124904dadb66814613099e0f8.bundle ADDED
Binary file (18.8 kB). View file
 
StreamingAssets/aa/WebGL/lowpolyinterior2_assets_all_4a73d1ff1ebc52c3da3dcf77de554510.bundle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a03c75d2514fc1ab8f6c19bb8dc0d92f250e5e20de752fb79e284517530e8bd0
3
+ size 34620687
StreamingAssets/aa/catalog.json CHANGED
The diff for this file is too large to render. See raw diff
 
StreamingAssets/aa/settings.json CHANGED
@@ -1 +1 @@
1
- {"m_buildTarget":"WebGL","m_SettingsHash":"785e061b03e25d7f02130655737dddf2","m_CatalogLocations":[{"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json","m_Provider":"UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_ClassName":"UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData"},"SerializedData":[]}],"m_ProfileEvents":false,"m_LogResourceManagerExceptions":true,"m_ExtraInitializationData":[],"m_DisableCatalogUpdateOnStart":false,"m_IsLocalCatalogInBundle":false,"m_CertificateHandlerType":{"m_AssemblyName":"","m_ClassName":""},"m_AddressablesVersion":"1.21.10","m_maxConcurrentWebRequests":3,"m_CatalogRequestsTimeout":0}
 
1
+ {"m_buildTarget":"WebGL","m_SettingsHash":"6c5b529a4eae02ee57053a61d7271cf7","m_CatalogLocations":[{"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json","m_Provider":"UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_ClassName":"UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData"},"SerializedData":[]}],"m_ProfileEvents":false,"m_LogResourceManagerExceptions":true,"m_ExtraInitializationData":[],"m_DisableCatalogUpdateOnStart":false,"m_IsLocalCatalogInBundle":false,"m_CertificateHandlerType":{"m_AssemblyName":"","m_ClassName":""},"m_AddressablesVersion":"1.21.10","m_maxConcurrentWebRequests":3,"m_CatalogRequestsTimeout":0}
TemplateData/style.css CHANGED
@@ -1,105 +1,105 @@
1
- html {
2
- box-sizing: border-box;
3
- }
4
- *, *:before, *:after {
5
- box-sizing: inherit;
6
- }
7
- html, body {
8
- height: 100%;
9
- }
10
- canvas {
11
- display: block;
12
- }
13
- body {
14
- margin: 0;
15
- }
16
- #unity-container {
17
- width: 100%;
18
- height: 100%;
19
- }
20
- #unity-canvas {
21
- width: 100%;
22
- height: 100%;
23
- background: #231F20;
24
- }
25
- #loading-cover {
26
- position: absolute;
27
- top: 0;
28
- left: 0;
29
- width: 100%;
30
- height: 100%;
31
- display: flex;
32
- justify-content: center;
33
- align-items: center;
34
- }
35
- #unity-loading-bar {
36
- flex: 1 1 auto;
37
- display: flex;
38
- flex-direction: column;
39
- justify-content: center;
40
- align-items: center;
41
- }
42
- #unity-logo {
43
- text-align: center;
44
- }
45
- #unity-logo img {
46
- max-width: 80%;
47
- }
48
- #unity-progress-bar-empty {
49
- width: 80%;
50
- height: 24px;
51
- margin: 10px 20px 20px 10px;
52
- text-align: left;
53
- border: 1px solid white;
54
- padding: 2px;
55
- }
56
- #unity-progress-bar-full {
57
- width: 0%;
58
- height: 100%;
59
- background: #ffd21e;
60
- }
61
- .light #unity-progress-bar-empty {
62
- border-color: black;
63
- }
64
- .light #unity-progress-bar-full {
65
- background: black;
66
- }
67
-
68
- #unity-fullscreen-button {
69
- position: absolute;
70
- right: 10px;
71
- bottom: 10px;
72
- width: 38px;
73
- height: 38px;
74
- background: url('fullscreen-button.png') no-repeat center;
75
- background-size: contain;
76
- }
77
-
78
- .spinner,
79
- .spinner:after {
80
- border-radius: 50%;
81
- width: 5em;
82
- height: 5em;
83
- }
84
- .spinner {
85
- margin: 10px;
86
- font-size: 10px;
87
- position: relative;
88
- text-indent: -9999em;
89
- border-top: 1.1em solid rgba(255, 255, 255, 0.2);
90
- border-right: 1.1em solid rgba(255, 255, 255, 0.2);
91
- border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
92
- border-left: 1.1em solid #ffffff;
93
- transform: translateZ(0);
94
- animation: spinner-spin 1.1s infinite linear;
95
- }
96
- @keyframes spinner-spin {
97
- 0% {
98
- transform: rotate(0deg);
99
- }
100
- 100% {
101
- transform: rotate(360deg);
102
- }
103
- }
104
-
105
-
 
1
+ html {
2
+ box-sizing: border-box;
3
+ }
4
+ *, *:before, *:after {
5
+ box-sizing: inherit;
6
+ }
7
+ html, body {
8
+ height: 100%;
9
+ }
10
+ canvas {
11
+ display: block;
12
+ }
13
+ body {
14
+ margin: 0;
15
+ }
16
+ #unity-container {
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+ #unity-canvas {
21
+ width: 100%;
22
+ height: 100%;
23
+ background: #231F20;
24
+ }
25
+ #loading-cover {
26
+ position: absolute;
27
+ top: 0;
28
+ left: 0;
29
+ width: 100%;
30
+ height: 100%;
31
+ display: flex;
32
+ justify-content: center;
33
+ align-items: center;
34
+ }
35
+ #unity-loading-bar {
36
+ flex: 1 1 auto;
37
+ display: flex;
38
+ flex-direction: column;
39
+ justify-content: center;
40
+ align-items: center;
41
+ }
42
+ #unity-logo {
43
+ text-align: center;
44
+ }
45
+ #unity-logo img {
46
+ max-width: 80%;
47
+ }
48
+ #unity-progress-bar-empty {
49
+ width: 80%;
50
+ height: 24px;
51
+ margin: 10px 20px 20px 10px;
52
+ text-align: left;
53
+ border: 1px solid white;
54
+ padding: 2px;
55
+ }
56
+ #unity-progress-bar-full {
57
+ width: 0%;
58
+ height: 100%;
59
+ background: #ffd21e;
60
+ }
61
+ .light #unity-progress-bar-empty {
62
+ border-color: black;
63
+ }
64
+ .light #unity-progress-bar-full {
65
+ background: black;
66
+ }
67
+
68
+ #unity-fullscreen-button {
69
+ position: absolute;
70
+ right: 10px;
71
+ bottom: 10px;
72
+ width: 38px;
73
+ height: 38px;
74
+ background: url('fullscreen-button.png') no-repeat center;
75
+ background-size: contain;
76
+ }
77
+
78
+ .spinner,
79
+ .spinner:after {
80
+ border-radius: 50%;
81
+ width: 5em;
82
+ height: 5em;
83
+ }
84
+ .spinner {
85
+ margin: 10px;
86
+ font-size: 10px;
87
+ position: relative;
88
+ text-indent: -9999em;
89
+ border-top: 1.1em solid rgba(255, 255, 255, 0.2);
90
+ border-right: 1.1em solid rgba(255, 255, 255, 0.2);
91
+ border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
92
+ border-left: 1.1em solid #ffffff;
93
+ transform: translateZ(0);
94
+ animation: spinner-spin 1.1s infinite linear;
95
+ }
96
+ @keyframes spinner-spin {
97
+ 0% {
98
+ transform: rotate(0deg);
99
+ }
100
+ 100% {
101
+ transform: rotate(360deg);
102
+ }
103
+ }
104
+
105
+
index.html CHANGED
@@ -1,92 +1,92 @@
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
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
7
- <title>LEGENT</title>
8
- <link rel="shortcut icon" href="TemplateData/favicon.ico">
9
- <link rel="stylesheet" href="TemplateData/style.css">
10
- </head>
11
- <body class="dark">
12
- <div id="unity-container" class="unity-desktop">
13
- <canvas id="unity-canvas"></canvas>
14
- </div>
15
- <div id="loading-cover" style="display:none;">
16
- <div id="unity-loading-bar">
17
- <div id="unity-logo"><img src="logo.png"></div>
18
- <div id="unity-progress-bar-empty" style="display: none;">
19
- <div id="unity-progress-bar-full"></div>
20
- </div>
21
- <div class="spinner"></div>
22
- </div>
23
- </div>
24
- <div id="unity-fullscreen-button" style="display: none;"></div>
25
- <script>
26
- const hideFullScreenButton = "";
27
- const buildUrl = "Build";
28
- const loaderUrl = buildUrl + "/202404280742.loader.js";
29
- const config = {
30
- dataUrl: buildUrl + "/202404280742.data",
31
- frameworkUrl: buildUrl + "/202404280742.framework.js",
32
- codeUrl: buildUrl + "/202404280742.wasm",
33
- streamingAssetsUrl: "StreamingAssets",
34
- companyName: "LEGENT",
35
- productName: "LEGENT",
36
- productVersion: "0.1",
37
- };
38
-
39
- const container = document.querySelector("#unity-container");
40
- const canvas = document.querySelector("#unity-canvas");
41
- const loadingCover = document.querySelector("#loading-cover");
42
- const progressBarEmpty = document.querySelector("#unity-progress-bar-empty");
43
- const progressBarFull = document.querySelector("#unity-progress-bar-full");
44
- const fullscreenButton = document.querySelector("#unity-fullscreen-button");
45
- const spinner = document.querySelector('.spinner');
46
-
47
- const canFullscreen = (function() {
48
- for (const key of [
49
- 'exitFullscreen',
50
- 'webkitExitFullscreen',
51
- 'webkitCancelFullScreen',
52
- 'mozCancelFullScreen',
53
- 'msExitFullscreen',
54
- ]) {
55
- if (key in document) {
56
- return true;
57
- }
58
- }
59
- return false;
60
- }());
61
-
62
- if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
63
- container.className = "unity-mobile";
64
- config.devicePixelRatio = 1;
65
- }
66
- loadingCover.style.display = "";
67
-
68
- const script = document.createElement("script");
69
- script.src = loaderUrl;
70
- script.onload = () => {
71
- createUnityInstance(canvas, config, (progress) => {
72
- spinner.style.display = "none";
73
- progressBarEmpty.style.display = "";
74
- progressBarFull.style.width = `${100 * progress}%`;
75
- }).then((unityInstance) => {
76
- loadingCover.style.display = "none";
77
- if (canFullscreen) {
78
- if (!hideFullScreenButton) {
79
- fullscreenButton.style.display = "";
80
- }
81
- fullscreenButton.onclick = () => {
82
- unityInstance.SetFullscreen(1);
83
- };
84
- }
85
- }).catch((message) => {
86
- alert(message);
87
- });
88
- };
89
- document.body.appendChild(script);
90
- </script>
91
- </body>
92
- </html>
 
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
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
7
+ <title>LEGENT</title>
8
+ <link rel="shortcut icon" href="TemplateData/favicon.ico">
9
+ <link rel="stylesheet" href="TemplateData/style.css">
10
+ </head>
11
+ <body class="dark">
12
+ <div id="unity-container" class="unity-desktop">
13
+ <canvas id="unity-canvas"></canvas>
14
+ </div>
15
+ <div id="loading-cover" style="display:none;">
16
+ <div id="unity-loading-bar">
17
+ <div id="unity-logo"><img src="logo.png"></div>
18
+ <div id="unity-progress-bar-empty" style="display: none;">
19
+ <div id="unity-progress-bar-full"></div>
20
+ </div>
21
+ <div class="spinner"></div>
22
+ </div>
23
+ </div>
24
+ <div id="unity-fullscreen-button" style="display: none;"></div>
25
+ <script>
26
+ const hideFullScreenButton = "";
27
+ const buildUrl = "Build";
28
+ const loaderUrl = buildUrl + "/202405050231.loader.js";
29
+ const config = {
30
+ dataUrl: buildUrl + "/202405050231.data",
31
+ frameworkUrl: buildUrl + "/202405050231.framework.js",
32
+ codeUrl: buildUrl + "/202405050231.wasm",
33
+ streamingAssetsUrl: "StreamingAssets",
34
+ companyName: "LEGENT",
35
+ productName: "LEGENT",
36
+ productVersion: "0.1",
37
+ };
38
+
39
+ const container = document.querySelector("#unity-container");
40
+ const canvas = document.querySelector("#unity-canvas");
41
+ const loadingCover = document.querySelector("#loading-cover");
42
+ const progressBarEmpty = document.querySelector("#unity-progress-bar-empty");
43
+ const progressBarFull = document.querySelector("#unity-progress-bar-full");
44
+ const fullscreenButton = document.querySelector("#unity-fullscreen-button");
45
+ const spinner = document.querySelector('.spinner');
46
+
47
+ const canFullscreen = (function() {
48
+ for (const key of [
49
+ 'exitFullscreen',
50
+ 'webkitExitFullscreen',
51
+ 'webkitCancelFullScreen',
52
+ 'mozCancelFullScreen',
53
+ 'msExitFullscreen',
54
+ ]) {
55
+ if (key in document) {
56
+ return true;
57
+ }
58
+ }
59
+ return false;
60
+ }());
61
+
62
+ if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
63
+ container.className = "unity-mobile";
64
+ config.devicePixelRatio = 1;
65
+ }
66
+ loadingCover.style.display = "";
67
+
68
+ const script = document.createElement("script");
69
+ script.src = loaderUrl;
70
+ script.onload = () => {
71
+ createUnityInstance(canvas, config, (progress) => {
72
+ spinner.style.display = "none";
73
+ progressBarEmpty.style.display = "";
74
+ progressBarFull.style.width = `${100 * progress}%`;
75
+ }).then((unityInstance) => {
76
+ loadingCover.style.display = "none";
77
+ if (canFullscreen) {
78
+ if (!hideFullScreenButton) {
79
+ fullscreenButton.style.display = "";
80
+ }
81
+ fullscreenButton.onclick = () => {
82
+ unityInstance.SetFullscreen(1);
83
+ };
84
+ }
85
+ }).catch((message) => {
86
+ alert(message);
87
+ });
88
+ };
89
+ document.body.appendChild(script);
90
+ </script>
91
+ </body>
92
+ </html>