index.html 2.6 KB

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