index.html 2.9 KB

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