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 <title>Unity WebGL Player | Neuroavatar Web</title> 7 <link rel="shortcut icon" href="TemplateData/favicon.ico"> 8 <link rel="stylesheet" href="TemplateData/style.css"> 9 <link rel="manifest" href="manifest.webmanifest"> 10
10<script src="TemplateData/ConvaiWebGLSDK.js"></script>
10 11 </head> 12 <body> 13 <div id="unity-container"> 14 <canvas id="unity-canvas" width=480 height=600 tabindex="-1"></canvas> 15 <div id="unity-loading-bar"> 16 <div id="unity-logo"></div> 17 <div id="unity-progress-bar-empty"> 18 <div id="unity-progress-bar-full"></div> 19 </div> 20 </div> 21 <div id="unity-warning"> </div> 22 </div> 23
23<script> 24 window.addEventListener("load", function () { 25 if ("serviceWorker" in navigator) { 26 navigator.serviceWorker.register("ServiceWorker.js"); 27 } 28 }); 29 30 var container = document.querySelector("#unity-container"); 31 var canvas = document.querySelector("#unity-canvas"); 32 var loadingBar = document.querySelector("#unity-loading-bar"); 33 var progressBarFull = document.querySelector("#unity-progress-bar-full"); 34 var warningBanner = document.querySelector("#unity-warning"); 35 36 // Shows a temporary message banner/ribbon for a few seconds, or 37 // a permanent error message on top of the canvas if type=='error'. 38 // If type=='warning', a yellow highlight color is used. 39 // Modify or remove this function to customize the visually presented 40 // way that non-critical warnings and error messages are presented to the 41 // user. 42 function unityShowBanner(msg, type) { 43 function updateBannerVisibility() { 44 warningBanner.style.display = warningBanner.children.length ? 'block' : 'none'; 45 } 46 var div = document.createElement('div'); 47 div.innerHTML = msg; 48 warningBanner.appendChild(div); 49 if (type == 'error') div.style = 'background: red; padding: 10px;'; 50 else { 51 if (type == 'warning') div.style = 'background: yellow; padding: 10px;'; 52 setTimeout(function() { 53 warningBanner.removeChild(div); 54 updateBannerVisibility(); 55 }, 5000); 56 } 57 updateBannerVisibility(); 58 } 59 60 var buildUrl = "Build"; 61 var loaderUrl = buildUrl + "/build-web 2.loader.js"; 62 var config = { 63 dataUrl: buildUrl + "/build-web 2.data", 64 frameworkUrl: buildUrl + "/build-web 2.framework.js", 65 codeUrl: buildUrl + "/build-web 2.wasm", 66 streamingAssetsUrl: "StreamingAssets", 67 companyName: "Neurobots", 68 productName: "Neuroavatar Web", 69 productVersion: "0.1", 70 showBanner: unityShowBanner, 71 }; 72 73 // By default Unity keeps WebGL canvas render target size matched with 74 // the DOM size of the canvas element (scaled by window.devicePixelRatio) 75 // Set this to false if you want to decouple this synchronization from 76 // happening inside the engine, and you would instead like to size up 77 // the canvas DOM size and WebGL render target sizes yourself. 78 // config.matchWebGLToCanvasSize = false; 79 80 if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) { 81 // Mobile device style: fill the whole browser client area with the game canvas: 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 } 87 88 loadingBar.style.display = "block"; 89 90 var script = document.createElement("script"); 91 script.src = loaderUrl; 92 script.onload = () => { 93 createUnityInstance(canvas, config, (progress) => { 94 progressBarFull.style.width = 100 * progress + "%"; 95 }).then((unityInstance) => { 96 loadingBar.style.display = "none"; 97 }).catch((message) => { 98 alert(message); 99 }); 100 }; 101 document.body.appendChild(script); 102 </script>
102 103 </body> 104</html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.