update0909 commited on
Commit
d5424c3
1 Parent(s): 840d53b

Upload 14 files

Browse files
Build/aaa.loader.js ADDED
@@ -0,0 +1 @@
 
 
1
+ function createUnityInstance(t,n,c){function s(e,t){if(!s.aborted&&n.showBanner)return"error"==t&&(s.aborted=!0),n.showBanner(e,t);switch(t){case"error":console.error(e);break;case"warning":console.warn(e);break;default:console.log(e)}}function r(e){var t=e.reason||e.error,n=t?t.toString():e.message||e.reason||"",r=t&&t.stack?t.stack.toString():"";(n+="\n"+(r=r.startsWith(n)?r.substring(n.length):r).trim())&&l.stackTraceRegExp&&l.stackTraceRegExp.test(n)&&D(n,e.filename||t&&(t.fileName||t.sourceURL)||"",e.lineno||t&&(t.lineNumber||t.line)||0)}function e(e,t,n){var r=e[t];void 0!==r&&r||(console.warn('Config option "'+t+'" is missing or empty. Falling back to default value: "'+n+'". Consider updating your WebGL template to include the missing config option.'),e[t]=n)}c=c||function(){};var o,l={canvas:t,webglContextAttributes:{preserveDrawingBuffer:!1,powerPreference:2},cacheControl:function(e){return e==l.dataUrl||e.match(/\.bundle/)?"must-revalidate":"no-store"},streamingAssetsUrl:"StreamingAssets",downloadProgress:{},deinitializers:[],intervals:{},setInterval:function(e,t){e=window.setInterval(e,t);return this.intervals[e]=!0,e},clearInterval:function(e){delete this.intervals[e],window.clearInterval(e)},preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e),"string"==typeof e&&-1!=e.indexOf("wasm streaming compile failed")&&(-1!=e.toLowerCase().indexOf("mime")?s('HTTP Response Header "Content-Type" configured incorrectly on the server for file '+l.codeUrl+' , should be "application/wasm". Startup time performance will suffer.',"warning"):s('WebAssembly streaming compilation failed! This can happen for example if "Content-Encoding" HTTP header is incorrectly enabled on the server for file '+l.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"))},locateFile:function(e){return"build.wasm"==e?this.codeUrl:e},disabledCanvasEvents:["contextmenu","dragstart"]};for(o in e(n,"companyName","Unity"),e(n,"productName","WebGL Player"),e(n,"productVersion","1.0"),n)l[o]=n[o];l.streamingAssetsUrl=new URL(l.streamingAssetsUrl,document.URL).href;var a=l.disabledCanvasEvents.slice();function i(e){e.preventDefault()}a.forEach(function(e){t.addEventListener(e,i)}),window.addEventListener("error",r),window.addEventListener("unhandledrejection",r);var u="",d="";function h(e){document.webkitCurrentFullScreenElement===t?t.style.width&&(u=t.style.width,d=t.style.height,t.style.width="100%",t.style.height="100%"):u&&(t.style.width=u,t.style.height=d,d=u="")}document.addEventListener("webkitfullscreenchange",h),l.deinitializers.push(function(){for(var e in l.disableAccessToMediaDevices(),a.forEach(function(e){t.removeEventListener(e,i)}),window.removeEventListener("error",r),window.removeEventListener("unhandledrejection",r),document.removeEventListener("webkitfullscreenchange",h),l.intervals)window.clearInterval(e);l.intervals={}}),l.QuitCleanup=function(){for(var e=0;e<l.deinitializers.length;e++)l.deinitializers[e]();l.deinitializers=[],"function"==typeof l.onQuit&&l.onQuit()};var f,p,m,g,b,v,w,y,S,C={Module:l,SetFullscreen:function(){if(l.SetFullscreen)return l.SetFullscreen.apply(l,arguments);l.print("Failed to set Fullscreen mode: Player not loaded yet.")},SendMessage:function(){if(l.SendMessage)return l.SendMessage.apply(l,arguments);l.print("Failed to execute SendMessage: Player not loaded yet.")},Quit:function(){return new Promise(function(e,t){l.shouldQuit=!0,l.onQuit=e})},GetMemoryInfo:function(){var e=l._getMemInfo();return{totalWASMHeapSize:l.HEAPU32[e>>2],usedWASMHeapSize:l.HEAPU32[1+(e>>2)],totalJSHeapSize:l.HEAPF64[1+(e>>3)],usedJSHeapSize:l.HEAPF64[2+(e>>3)]}}};function D(e,t,n){-1==e.indexOf("fullscreen error")&&(l.startupErrorHandler?l.startupErrorHandler(e,t,n):l.errorHandler&&l.errorHandler(e,t,n)||(console.log("Invoking error handler due to\n"+e),"function"==typeof dump&&dump("Invoking error handler due to\n"+e),D.didShowErrorMessage||(-1!=(e="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+e).indexOf("DISABLE_EXCEPTION_CATCHING")?e="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.":-1!=e.indexOf("Cannot enlarge memory arrays")?e="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":-1==e.indexOf("Invalid array buffer length")&&-1==e.indexOf("Invalid typed array length")&&-1==e.indexOf("out of memory")&&-1==e.indexOf("could not allocate memory")||(e="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."),alert(e),D.didShowErrorMessage=!0)))}function P(e,t){if("symbolsUrl"!=e){var n=l.downloadProgress[e],r=(n=n||(l.downloadProgress[e]={started:!1,finished:!1,lengthComputable:!1,total:0,loaded:0}),"object"!=typeof t||"progress"!=t.type&&"load"!=t.type||(n.started||(n.started=!0,n.lengthComputable=t.lengthComputable),n.total=t.total,n.loaded=t.loaded,"load"==t.type&&(n.finished=!0)),0),o=0,a=0,i=0,s=0;for(e in l.downloadProgress){if(!(n=l.downloadProgress[e]).started)return;a++,n.lengthComputable?(r+=n.loaded,o+=n.total,i++):n.finished||s++}c(.9*(a?(a-s-(o?i*(o-r)/o:0))/a:0))}}function x(){var e=this;this.isConnected=this.connect().then(function(){return e.cleanUpCache()}),this.isConnected.catch(function(e){e="Error when initializing cache: "+e,console.log("[UnityCache] "+e)})}function E(e){console.log("[UnityCache] "+e)}function U(e){return U.link=U.link||document.createElement("a"),U.link.href=e,U.link.href}function T(){new Promise(function(a,e){var i=document.createElement("script");i.src=l.frameworkUrl,i.onload=function(){if("undefined"==typeof unityFramework||!unityFramework){var e,t=[["br","br"],["gz","gzip"]];for(e in t){var n,r=t[e];if(l.frameworkUrl.endsWith("."+r[0]))return n="Unable to parse "+l.frameworkUrl+"!","file:"==location.protocol?void s(n+" 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"):(n+=' 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: '+r[1]+'" present. Check browser Console and Devtools Network tab to debug.',"br"==r[0]&&"http:"==location.protocol&&(r=-1!=["localhost","127.0.0.1"].indexOf(location.hostname)?"":"Migrate your server to use HTTPS.",n=/Firefox/.test(navigator.userAgent)?"Unable to parse "+l.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. '+r+' 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.':"Unable to parse "+l.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.'),void s(n,"error"))}s("Unable to parse "+l.frameworkUrl+"! The file is corrupt, or compression was misconfigured? (check Content-Encoding HTTP Response Header on web server)","error")}var o=unityFramework;unityFramework=null,i.onload=null,a(o)},i.onerror=function(e){s("Unable to load file "+l.frameworkUrl+"! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)","error")},document.body.appendChild(i),l.deinitializers.push(function(){document.body.removeChild(i)})}).then(function(e){e(l)});P(n="dataUrl"),e=l.cacheControl(l[n]),t=l.companyName&&l.productName?l.cachedFetch:l.fetchWithProgress,r=l[n],r=/file:\/\//.exec(r)?"same-origin":void 0;var n,e,t,r,o=t(l[n],{method:"GET",companyName:l.companyName,productName:l.productName,productVersion:l.productVersion,control:e,mode:r,onProgress:function(e){P(n,e)}}).then(function(e){return e.parsedBody}).catch(function(e){var t="Failed to download file "+l[n];"file:"==location.protocol?s(t+". 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"):console.error(t)});l.preRun.push(function(){l.addRunDependency("dataUrl"),o.then(function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=0,r="UnityWebData1.0\0";if(!String.fromCharCode.apply(null,e.subarray(n,n+r.length))==r)throw"unknown data format";var o=t.getUint32(n+=r.length,!0);for(n+=4;n<o;){var a=t.getUint32(n,!0),i=(n+=4,t.getUint32(n,!0)),s=(n+=4,t.getUint32(n,!0)),c=(n+=4,String.fromCharCode.apply(null,e.subarray(n,n+s)));n+=s;for(var u=0,d=c.indexOf("/",u)+1;0<d;u=d,d=c.indexOf("/",u)+1)l.FS_createPath(c.substring(0,u),c.substring(u,d-1),!0,!0);l.FS_createDataFile(c,null,e.subarray(a,a+i),!0,!0,!0)}l.removeRunDependency("dataUrl")})})}return l.SystemInfo=function(){var e,t,n,r,o=navigator.userAgent+" ",a=[["Firefox","Firefox"],["OPR","Opera"],["Edg","Edge"],["SamsungBrowser","Samsung Browser"],["Trident","Internet Explorer"],["MSIE","Internet Explorer"],["Chrome","Chrome"],["CriOS","Chrome on iOS Safari"],["FxiOS","Firefox on iOS Safari"],["Safari","Safari"]];function i(e,t,n){return(e=RegExp(e,"i").exec(t))&&e[n]}for(var s=0;s<a.length;++s)if(t=i(a[s][0]+"[/ ](.*?)[ \\)]",o,1)){e=a[s][1];break}"Safari"==e&&(t=i("Version/(.*?) ",o,1)),"Internet Explorer"==e&&(t=i("rv:(.*?)\\)? ",o,1)||t);for(var c=[["Windows (.*?)[;)]","Windows"],["Android ([0-9_.]+)","Android"],["iPhone OS ([0-9_.]+)","iPhoneOS"],["iPad.*? OS ([0-9_.]+)","iPadOS"],["FreeBSD( )","FreeBSD"],["OpenBSD( )","OpenBSD"],["Linux|X11()","Linux"],["Mac OS X ([0-9_\\.]+)","MacOS"],["bot|google|baidu|bing|msn|teoma|slurp|yandex","Search Bot"]],u=0;u<c.length;++u)if(d=i(c[u][0],o,1)){n=c[u][1],d=d.replace(/_/g,".");break}var d={"NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"Server 2003","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 10.0":"10"}[d]||d,l=((l=document.createElement("canvas"))&&(gl=l.getContext("webgl2"),glVersion=gl?2:0,gl||(gl=l&&l.getContext("webgl"))&&(glVersion=1),gl&&(r=gl.getExtension("WEBGL_debug_renderer_info")&&gl.getParameter(37446)||gl.getParameter(7937))),"undefined"!=typeof SharedArrayBuffer),h="object"==typeof WebAssembly&&"function"==typeof WebAssembly.compile;return{width:screen.width,height:screen.height,userAgent:o.trim(),browser:e||"Unknown browser",browserVersion:t||"Unknown version",mobile:/Mobile|Android|iP(ad|hone)/.test(navigator.appVersion),os:n||"Unknown OS",osVersion:d||"Unknown OS Version",gpu:r||"Unknown GPU",language:navigator.userLanguage||navigator.language,hasWebGL:glVersion,hasCursorLock:!!document.body.requestPointerLock,hasFullscreen:!!document.body.requestFullscreen||!!document.body.webkitRequestFullscreen,hasThreads:l,hasWasm:h,hasWasmThreads:!1}}(),l.abortHandler=function(e){return D(e,"",0),!0},Error.stackTraceLimit=Math.max(Error.stackTraceLimit||0,50),l.readBodyWithProgress=function(a,i,s){var e=a.body?a.body.getReader():void 0,c=void 0!==a.headers.get("Content-Length"),u=function(e,t){if(!t)return 0;var t=e.headers.get("Content-Encoding"),n=parseInt(e.headers.get("Content-Length"));switch(t){case"br":return Math.round(5*n);case"gzip":return Math.round(4*n);default:return n}}(a,c),d=new Uint8Array(u),l=[],h=0,f=0;return c||console.warn("[UnityCache] Response is served without Content-Length header. Please reconfigure server to include valid Content-Length for better download performance."),function o(){return void 0===e?a.arrayBuffer().then(function(e){var t=new Uint8Array(e);return i({type:"progress",response:a,total:e.length,loaded:0,lengthComputable:c,chunk:s?t:null}),t}):e.read().then(function(e){if(e.done){if(h===u)return d;if(h<u)return d.slice(0,h);for(var t=new Uint8Array(h),n=(t.set(d,0),f),r=0;r<l.length;++r)t.set(l[r],n),n+=l[r].length;return t}return h+e.value.length<=d.length?(d.set(e.value,h),f=h+e.value.length):l.push(e.value),h+=e.value.length,i({type:"progress",response:a,total:Math.max(u,h),loaded:h,lengthComputable:c,chunk:s?e.value:null}),o()})}().then(function(e){return i({type:"load",response:a,total:e.length,loaded:e.length,lengthComputable:c,chunk:null}),a.parsedBody=e,a})},l.fetchWithProgress=function(e,t){var n=function(){};return t&&t.onProgress&&(n=t.onProgress),fetch(e,t).then(function(e){return l.readBodyWithProgress(e,n,t.enableStreamingDownload)})},l.UnityCache=(f={name:"UnityCache",version:4},p={name:"RequestMetaDataStore",version:1},m="RequestStore",g="WebAssembly",b=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,v=null,x.getInstance=function(){return v=v||new x},x.destroyInstance=function(){return v?v.close().then(function(){v=null}):Promise.resolve()},x.prototype.clearCache=function(){var r=this;return this.isConnected.then(function(){return r.execute(p.name,"clear",[])}).then(function(){return r.cache.keys()}).then(function e(t){var n;return 0===t.length?Promise.resolve():(n=t.pop(),r.cache.delete(n).then(function(){return e(t)}))})},x.UnityCacheDatabase=f,x.RequestMetaDataStore=p,x.MaximumCacheSize=1073741824,x.prototype.loadRequest=function(e){var t=this;return t.isConnected.then(function(){return Promise.all([t.cache.match(e),t.loadRequestMetaData(e)])}).then(function(e){if(void 0!==e[0]&&void 0!==e[1])return{response:e[0],metaData:e[1]}})},x.prototype.loadRequestMetaData=function(e){e="string"==typeof e?e:e.url;return this.execute(p.name,"get",[e])},x.prototype.updateRequestMetaData=function(e){return this.execute(p.name,"put",[e])},x.prototype.storeRequest=function(e,t){var n=this;return n.isConnected.then(function(){return n.cache.put(e,t)})},x.prototype.close=function(){return this.isConnected.then(function(){this.database&&(this.database.close(),this.database=null),this.cache&&(this.cache=null)}.bind(this))},x.prototype.connect=function(){var o=this;return void 0===b?Promise.reject(new Error("Could not connect to cache: IndexedDB is not supported.")):void 0===window.caches?Promise.reject(new Error("Could not connect to cache: Cache API is not supported.")):new Promise(function(t,n){try{function r(){o.openDBTimeout&&(clearTimeout(o.openDBTimeout),o.openDBTimeout=null)}o.openDBTimeout=setTimeout(function(){void 0===o.database&&n(new Error("Could not connect to cache: Database timeout."))},2e4);var e=b.open(f.name,f.version);e.onupgradeneeded=o.upgradeDatabase.bind(o),e.onsuccess=function(e){r(),o.database=e.target.result,t()},e.onerror=function(e){r(),o.database=null,n(new Error("Could not connect to database."))}}catch(e){r(),o.database=null,o.cache=null,n(new Error("Could not connect to cache: Could not connect to database."))}}).then(function(){var e=f.name+"_"+l.companyName+"_"+l.productName;return caches.open(e)}).then(function(e){o.cache=e})},x.prototype.upgradeDatabase=function(e){var t,e=e.target.result;e.objectStoreNames.contains(p.name)||(t=e.createObjectStore(p.name,{keyPath:"url"}),["accessedAt","updatedAt"].forEach(function(e){t.createIndex(e,e)})),e.objectStoreNames.contains(m)&&e.deleteObjectStore(m),e.objectStoreNames.contains(g)&&e.deleteObjectStore(g)},x.prototype.execute=function(a,i,s){return this.isConnected.then(function(){return new Promise(function(t,n){try{var e,r,o;null===this.database?n(new Error("indexedDB access denied")):(e=-1!=["put","delete","clear"].indexOf(i)?"readwrite":"readonly",r=this.database.transaction([a],e).objectStore(a),"openKeyCursor"==i&&(r=r.index(s[0]),s=s.slice(1)),(o=r[i].apply(r,s)).onsuccess=function(e){t(e.target.result)},o.onerror=function(e){n(e)})}catch(e){n(e)}}.bind(this))}.bind(this))},x.prototype.getMetaDataEntries=function(){var r=this,o=0,a=[];return new Promise(function(t,n){var e=r.database.transaction([p.name],"readonly").objectStore(p.name).openCursor();e.onsuccess=function(e){e=e.target.result;e?(o+=e.value.size,a.push(e.value),e.continue()):t({metaDataEntries:a,cacheSize:o})},e.onerror=function(e){n(e)}})},x.prototype.cleanUpCache=function(){var i=this;return this.getMetaDataEntries().then(function(e){for(var t=e.metaDataEntries,n=e.cacheSize,r=[],o=[],a=0;a<t.length;++a)t[a].version==l.productVersion?o.push(t[a]):(r.push(t[a]),n-=t[a].size);o.sort(function(e,t){return e.accessedAt-t.accessedAt});for(a=0;a<o.length&&!(n<x.MaximumCacheSize);++a)r.push(o[a]),n-=o[a].size;return function e(){var t;return 0===r.length?Promise.resolve():(t=r.pop(),i.cache.delete(t.url).then(function(e){if(e)return r=t.url,new Promise(function(e,t){var n=i.database.transaction([p.name],"readwrite");n.objectStore(p.name).delete(r),n.oncomplete=e,n.onerror=t});var r}).then(e))}()})},x),l.cachedFetch=(w=l.UnityCache,y=l.fetchWithProgress,S=l.readBodyWithProgress,function(o,a){var e,t,i=w.getInstance(),s=U("string"==typeof o?o:o.url),c={enabled:(e=s,(!(t=a)||!t.method||"GET"===t.method)&&((!t||-1!=["must-revalidate","immutable"].indexOf(t.control))&&!!e.match("^https?://")))};function u(n,r){return fetch(n,r).then(function(e){var t;return!c.enabled||c.revalidated?e:304===e.status?(c.revalidated=!0,i.updateRequestMetaData(c.metaData).then(function(){E("'"+c.metaData.url+"' successfully revalidated and served from the indexedDB cache")}).catch(function(e){E("'"+c.metaData.url+"' successfully revalidated but not stored in the indexedDB cache due to the error: "+e)}),S(c.response,r.onProgress,r.enableStreamingDownload)):200==e.status?(c.response=e,c.metaData.updatedAt=c.metaData.accessedAt,c.revalidated=!0,t=e.clone(),S(e,r.onProgress,r.enableStreamingDownload).then(function(e){return c.metaData.size=e.parsedBody.length,Promise.all([i.storeRequest(n,t),i.updateRequestMetaData(c.metaData)]).then(function(){E("'"+s+"' successfully downloaded and stored in the indexedDB cache")}).catch(function(e){E("'"+s+"' successfully downloaded but not stored in the indexedDB cache due to the error: "+e)}),e})):(E("'"+s+"' request failed with status: "+e.status+" "+e.statusText),S(e,r.onProgress,r.enableStreamingDownload))})}return a&&(c.control=a.control,c.companyName=a.companyName,c.productName=a.productName,c.productVersion=a.productVersion),c.revalidated=!1,c.metaData={url:s,accessedAt:Date.now(),version:c.productVersion},c.response=null,c.enabled?i.loadRequest(s).then(function(e){var n,r,t;return e?(n=e.response,r=e.metaData,c.response=n,c.metaData.size=r.size,c.metaData.updatedAt=r.updatedAt,"immutable"==c.control?(c.revalidated=!0,i.updateRequestMetaData(r).then(function(){E("'"+c.metaData.url+"' served from the indexedDB cache without revalidation")}),S(n,a.onProgress,a.enableStreamingDownload)):(e=s,(t=window.location.href.match(/^[a-z]+:\/\/[^\/]+/))&&!e.lastIndexOf(t[0],0)||!n.headers.get("Last-Modified")&&!n.headers.get("ETag")?(e=(a=a||{}).headers||{},a.headers=e,n.headers.get("Last-Modified")?(e["If-Modified-Since"]=n.headers.get("Last-Modified"),e["Cache-Control"]="no-cache"):n.headers.get("ETag")&&(e["If-None-Match"]=n.headers.get("ETag"),e["Cache-Control"]="no-cache"),u(o,a)):fetch(s,{method:"HEAD"}).then(function(t){return c.revalidated=["Last-Modified","ETag"].every(function(e){return!n.headers.get(e)||n.headers.get(e)==t.headers.get(e)}),c.revalidated?(i.updateRequestMetaData(r).then(function(){E("'"+c.metaData.url+"' successfully revalidated and served from the indexedDB cache")}),S(c.response,a.onProgress,a.enableStreamingDownload)):u(o,a)}))):u(o,a)}).catch(function(e){return E("Failed to load '"+c.metaData.url+"' from indexedDB cache due to the error: "+e),y(o,a)}):y(o,a)}),new Promise(function(e,t){var n;l.SystemInfo.hasWebGL?1==l.SystemInfo.hasWebGL?(n='Your browser does not support graphics API "WebGL 2" which is required for this content.',"Safari"==l.SystemInfo.browser&&parseInt(l.SystemInfo.browserVersion)<15&&(l.SystemInfo.mobile||1<navigator.maxTouchPoints?n+="\nUpgrade to iOS 15 or later.":n+="\nUpgrade to Safari 15 or later."),t(n)):l.SystemInfo.hasWasm?(l.startupErrorHandler=t,c(0),l.postRun.push(function(){c(1),delete l.startupErrorHandler,e(C)}),T()):t("Your browser does not support WebAssembly."):t("Your browser does not support WebGL.")})}
TemplateData/MemoryProfiler.png ADDED
TemplateData/favicon.ico CHANGED
TemplateData/progress-bar-empty-dark.png ADDED
TemplateData/progress-bar-empty-light.png ADDED
TemplateData/progress-bar-full-dark.png ADDED
TemplateData/progress-bar-full-light.png ADDED
TemplateData/style.css CHANGED
@@ -1,105 +1,16 @@
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: 40px;
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
+ body { padding: 0; margin: 0 }
2
+ #unity-container { position: absolute }
3
+ #unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
4
+ #unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
5
+ #unity-canvas { background: #231F20 }
6
+ .unity-mobile #unity-canvas { width: 100%; height: 100% }
7
+ #unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
8
+ #unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
9
+ #unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center }
10
+ #unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
11
+ #unity-footer { position: relative }
12
+ .unity-mobile #unity-footer { display: none }
13
+ #unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center }
14
+ #unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
15
+ #unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center }
16
+ #unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
TemplateData/unity-logo-dark.png ADDED
TemplateData/unity-logo-light.png ADDED
TemplateData/webgl-logo.png ADDED
TemplateData/webmemd-icon.png ADDED
index.html CHANGED
@@ -3,90 +3,120 @@
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>APIDemo</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 + "/Demo.loader.js";
29
- const config = {
30
- dataUrl: buildUrl + "/Demo.data",
31
- frameworkUrl: buildUrl + "/Demo.framework.js",
32
- codeUrl: buildUrl + "/Demo.wasm",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  streamingAssetsUrl: "StreamingAssets",
34
  companyName: "DefaultCompany",
35
- productName: "APIDemo",
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>
 
3
  <head>
4
  <meta charset="utf-8">
5
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6
+ <title>Unity WebGL Player | AIrestaurant</title>
 
7
  <link rel="shortcut icon" href="TemplateData/favicon.ico">
8
  <link rel="stylesheet" href="TemplateData/style.css">
9
  </head>
10
+ <body>
11
  <div id="unity-container" class="unity-desktop">
12
+ <canvas id="unity-canvas" width=960 height=600 tabindex="-1"></canvas>
 
 
13
  <div id="unity-loading-bar">
14
+ <div id="unity-logo"></div>
15
+ <div id="unity-progress-bar-empty">
16
  <div id="unity-progress-bar-full"></div>
17
  </div>
18
+ </div>
19
+ <div id="unity-warning"> </div>
20
+ <div id="unity-footer">
21
+ <div id="unity-webgl-logo"></div>
22
+ <div id="unity-fullscreen-button"></div>
23
+ <div id="unity-build-title">AIrestaurant</div>
24
  </div>
25
  </div>
 
26
  <script>
27
+
28
+ var container = document.querySelector("#unity-container");
29
+ var canvas = document.querySelector("#unity-canvas");
30
+ var loadingBar = document.querySelector("#unity-loading-bar");
31
+ var progressBarFull = document.querySelector("#unity-progress-bar-full");
32
+ var fullscreenButton = document.querySelector("#unity-fullscreen-button");
33
+ var warningBanner = document.querySelector("#unity-warning");
34
+
35
+ // Shows a temporary message banner/ribbon for a few seconds, or
36
+ // a permanent error message on top of the canvas if type=='error'.
37
+ // If type=='warning', a yellow highlight color is used.
38
+ // Modify or remove this function to customize the visually presented
39
+ // way that non-critical warnings and error messages are presented to the
40
+ // user.
41
+ function unityShowBanner(msg, type) {
42
+ function updateBannerVisibility() {
43
+ warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
44
+ }
45
+ var div = document.createElement('div');
46
+ div.innerHTML = msg;
47
+ warningBanner.appendChild(div);
48
+ if (type == 'error') div.style = 'background: red; padding: 10px;';
49
+ else {
50
+ if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
51
+ setTimeout(function() {
52
+ warningBanner.removeChild(div);
53
+ updateBannerVisibility();
54
+ }, 5000);
55
+ }
56
+ updateBannerVisibility();
57
+ }
58
+
59
+ var buildUrl = "Build";
60
+ var loaderUrl = buildUrl + "/aaa.loader.js";
61
+ var config = {
62
+ dataUrl: buildUrl + "/aaa.data.gz",
63
+ frameworkUrl: buildUrl + "/aaa.framework.js.gz",
64
+ codeUrl: buildUrl + "/aaa.wasm.gz",
65
  streamingAssetsUrl: "StreamingAssets",
66
  companyName: "DefaultCompany",
67
+ productName: "AIrestaurant",
68
  productVersion: "0.1",
69
+ showBanner: unityShowBanner,
70
  };
71
 
72
+ // By default Unity keeps WebGL canvas render target size matched with
73
+ // the DOM size of the canvas element (scaled by window.devicePixelRatio)
74
+ // Set this to false if you want to decouple this synchronization from
75
+ // happening inside the engine, and you would instead like to size up
76
+ // the canvas DOM size and WebGL render target sizes yourself.
77
+ // config.matchWebGLToCanvasSize = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
  if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
80
+ // Mobile device style: fill the whole browser client area with the game canvas:
81
+
82
+ var meta = document.createElement('meta');
83
+ meta.name = 'viewport';
84
+ meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
85
+ document.getElementsByTagName('head')[0].appendChild(meta);
86
  container.className = "unity-mobile";
87
+ canvas.className = "unity-mobile";
88
+
89
+ // To lower canvas resolution on mobile devices to gain some
90
+ // performance, uncomment the following line:
91
+ // config.devicePixelRatio = 1;
92
+
93
+
94
+ } else {
95
+ // Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
96
+
97
+ canvas.style.width = "960px";
98
+ canvas.style.height = "600px";
99
  }
 
100
 
101
+ loadingBar.style.display = "block";
102
+
103
+ var script = document.createElement("script");
104
  script.src = loaderUrl;
105
  script.onload = () => {
106
  createUnityInstance(canvas, config, (progress) => {
107
+ progressBarFull.style.width = 100 * progress + "%";
108
+ }).then((unityInstance) => {
109
+ loadingBar.style.display = "none";
110
+ fullscreenButton.onclick = () => {
111
+ unityInstance.SetFullscreen(1);
112
+ };
113
+ }).catch((message) => {
114
+ alert(message);
115
+ });
 
 
116
  };
117
+
 
 
 
 
118
  document.body.appendChild(script);
119
+
120
  </script>
121
  </body>
122
  </html>