index.html 3.0 KB

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