index.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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>{{{ PRODUCT_NAME }}}</title>
  7. </head>
  8. <body style="text-align: center; padding: 0; border: 0; margin: 0;">
  9. <div id="unity-container" class="unity-desktop">
  10. <canvas id="unity-canvas" width={{{ WIDTH }}} height={{{ HEIGHT }}} tabindex="-1" style="width: {{{ WIDTH }}}px; height: {{{ HEIGHT }}}px; background: {{{ BACKGROUND_FILENAME ? 'url(\'Build/' + BACKGROUND_FILENAME.replace(/'/g, '%27') + '\') center / cover' : BACKGROUND_COLOR }}}"></canvas>
  11. </div>
  12. <script src="Build/{{{ LOADER_FILENAME }}}"></script>
  13. <link rel="shortcut icon" href="TemplateData/icon.png">
  14. <link rel="stylesheet" href="TemplateData/style.css">
  15. <script src="StreamingAssets/hls.min.js"></script>
  16. <script>
  17. function Test01(){
  18. window.alert("Test 03");
  19. wx.minProgram.navigateTo({url:'/pages/scan/scene-scan-render/index'});
  20. }
  21. function Test02(str){
  22. window.alert(JSON.stringify(str));
  23. }
  24. if (typeof wx !== 'undefined') {
  25. console.log("2321312312321312312321");
  26. }
  27. var container = document.querySelector("#unity-container");
  28. container.className = "unity-mobile";
  29. // if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
  30. // Mobile device style: fill the whole browser client area with the game canvas:
  31. var meta = document.createElement('meta');
  32. meta.name = 'viewport';
  33. meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
  34. document.getElementsByTagName('head')[0].appendChild(meta);
  35. var canvas = document.querySelector("#unity-canvas");
  36. canvas.style.width = "100%";
  37. canvas.style.height = "100%";
  38. canvas.style.position = "fixed";
  39. document.body.style.textAlign = "left";
  40. // }
  41. createUnityInstance(document.querySelector("#unity-canvas"), {
  42. dataUrl: "Build/{{{ DATA_FILENAME }}}",
  43. frameworkUrl: "Build/{{{ FRAMEWORK_FILENAME }}}",
  44. #if USE_THREADS
  45. workerUrl: "Build/{{{ WORKER_FILENAME }}}",
  46. #endif
  47. #if USE_WASM
  48. codeUrl: "Build/{{{ CODE_FILENAME }}}",
  49. #endif
  50. #if MEMORY_FILENAME
  51. memoryUrl: "Build/{{{ MEMORY_FILENAME }}}",
  52. #endif
  53. #if SYMBOLS_FILENAME
  54. symbolsUrl: "Build/{{{ SYMBOLS_FILENAME }}}",
  55. #endif
  56. streamingAssetsUrl: "StreamingAssets",
  57. companyName: {{{ JSON.stringify(COMPANY_NAME) }}},
  58. productName: {{{ JSON.stringify(PRODUCT_NAME) }}},
  59. productVersion: {{{ JSON.stringify(PRODUCT_VERSION) }}},
  60. // matchWebGLToCanvasSize: false, // Uncomment this to separately control WebGL canvas render size and DOM element size.
  61. // devicePixelRatio: 1, // Uncomment this to override low DPI rendering on high DPI displays.
  62. }, (progress) => {
  63. }).then((unityInstance) => {
  64. window.unityInstance = unityInstance
  65. }).catch((message) => {
  66. alert(message);
  67. });
  68. </script>
  69. </body>
  70. </html>