index.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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>临港大屏</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=960 height=600 tabindex="-1" style="width: 960px; height: 600px; background: #231F20"></canvas>
  11. </div>
  12. <script src="Build/test.loader.js"></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/test.data.unityweb",
  41. frameworkUrl: "Build/test.framework.js.unityweb",
  42. codeUrl: "Build/test.wasm.unityweb",
  43. symbolsUrl: "Build/test.symbols.json.unityweb",
  44. streamingAssetsUrl: "StreamingAssets",
  45. companyName: "DefaultCompany",
  46. productName: "临港大屏",
  47. productVersion: "0.1",
  48. // matchWebGLToCanvasSize: false, // Uncomment this to separately control WebGL canvas render size and DOM element size.
  49. // devicePixelRatio: 1, // Uncomment this to override low DPI rendering on high DPI displays.
  50. }, (progress) => {
  51. }).then((unityInstance) => {
  52. window.unityInstance = unityInstance
  53. }).catch((message) => {
  54. alert(message);
  55. });
  56. </script>
  57. </body>
  58. </html>