Quellcode durchsuchen

unity小游戏更新

任一存 vor 1 Jahr
Ursprung
Commit
a95579e0fb
44 geänderte Dateien mit 147 neuen und 262 gelöschten Zeilen
  1. BIN
      game/public/unity/antibody-battle/Build/Build.data.unityweb
  2. BIN
      game/public/unity/antibody-battle/Build/Build.framework.js.unityweb
  3. 1 1
      game/public/unity/antibody-battle/Build/Build.loader.js
  4. BIN
      game/public/unity/antibody-battle/Build/Build.wasm.unityweb
  5. 0 33
      game/public/unity/antibody-battle/ServiceWorker.js
  6. 6 6
      game/public/unity/antibody-battle/TemplateData/style.css
  7. BIN
      game/public/unity/antibody-battle/TemplateData/webmemd-icon.png
  8. 42 31
      game/public/unity/antibody-battle/index.html
  9. 0 15
      game/public/unity/antibody-battle/manifest.webmanifest
  10. BIN
      game/public/unity/disaster-relief/Build/Build.data.unityweb
  11. BIN
      game/public/unity/disaster-relief/Build/Build.framework.js.unityweb
  12. 1 1
      game/public/unity/disaster-relief/Build/Build.loader.js
  13. BIN
      game/public/unity/disaster-relief/Build/Build.wasm.unityweb
  14. BIN
      game/public/unity/enviroment-protection/Build/Build.data.unityweb
  15. BIN
      game/public/unity/enviroment-protection/Build/Build.framework.js.unityweb
  16. 1 1
      game/public/unity/enviroment-protection/Build/Build.loader.js
  17. BIN
      game/public/unity/enviroment-protection/Build/Build.wasm.unityweb
  18. 0 33
      game/public/unity/enviroment-protection/ServiceWorker.js
  19. 6 6
      game/public/unity/enviroment-protection/TemplateData/style.css
  20. BIN
      game/public/unity/enviroment-protection/TemplateData/webmemd-icon.png
  21. 42 31
      game/public/unity/enviroment-protection/index.html
  22. 0 15
      game/public/unity/enviroment-protection/manifest.webmanifest
  23. BIN
      game/public/unity/lost-children/Build/H5Game-ChinaSecuritiesMuseumMaze.data.unityweb
  24. BIN
      game/public/unity/lost-children/Build/H5Game-ChinaSecuritiesMuseumMaze.framework.js.unityweb
  25. BIN
      game/public/unity/lost-children/Build/H5Game-ChinaSecuritiesMuseumMaze.wasm.unityweb
  26. BIN
      game/public/unity/lost-children/Build/寻找丢失儿童.data.unityweb
  27. BIN
      game/public/unity/lost-children/Build/寻找丢失儿童.framework.js.unityweb
  28. 0 1
      game/public/unity/lost-children/Build/寻找丢失儿童.loader.js
  29. BIN
      game/public/unity/lost-children/Build/寻找丢失儿童.wasm.unityweb
  30. 0 33
      game/public/unity/lost-children/ServiceWorker.js
  31. BIN
      game/public/unity/lost-children/TemplateData/icons/unity-logo-dark.png
  32. BIN
      game/public/unity/lost-children/TemplateData/icons/unity-logo-light.png
  33. 1 5
      game/public/unity/lost-children/TemplateData/style.css
  34. BIN
      game/public/unity/lost-children/TemplateData/unity-logo-dark.png
  35. BIN
      game/public/unity/lost-children/TemplateData/unity-logo-light.png
  36. BIN
      game/public/unity/lost-children/TemplateData/webmemd-icon.png
  37. 41 18
      game/public/unity/lost-children/index.html
  38. 0 15
      game/public/unity/lost-children/manifest.webmanifest
  39. 0 12
      game/public/unity/lost-children/unity.js
  40. 2 1
      game/src/api.js
  41. 1 1
      game/src/views/ExamPaper2.vue
  42. 1 1
      game/src/views/PairUp.vue
  43. 1 1
      game/src/views/PlantTree.vue
  44. 1 1
      game/src/views/ShopView.vue

BIN
game/public/unity/antibody-battle/Build/Build.data.unityweb


BIN
game/public/unity/antibody-battle/Build/Build.framework.js.unityweb


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
game/public/unity/antibody-battle/Build/Build.loader.js


BIN
game/public/unity/antibody-battle/Build/Build.wasm.unityweb


+ 0 - 33
game/public/unity/antibody-battle/ServiceWorker.js

@@ -1,33 +0,0 @@
-const cacheName = "4dage-VirusWar-0.1.0";
-const contentToCache = [
-    "Build/Build.loader.js",
-    "Build/Build.framework.js.unityweb",
-    "Build/Build.data.unityweb",
-    "Build/Build.wasm.unityweb",
-    "TemplateData/style.css"
-
-];
-
-self.addEventListener('install', function (e) {
-    console.log('[Service Worker] Install');
-    
-    e.waitUntil((async function () {
-      const cache = await caches.open(cacheName);
-      console.log('[Service Worker] Caching all: app shell and content');
-      await cache.addAll(contentToCache);
-    })());
-});
-
-self.addEventListener('fetch', function (e) {
-    e.respondWith((async function () {
-      let response = await caches.match(e.request);
-      console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
-      if (response) { return response; }
-
-      response = await fetch(e.request);
-      const cache = await caches.open(cacheName);
-      console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
-      cache.put(e.request, response.clone());
-      return response;
-    })());
-});

+ 6 - 6
game/public/unity/antibody-battle/TemplateData/style.css

@@ -1,7 +1,7 @@
 body { padding: 0; margin: 0 }
-#tuanjie-container { position: fixed; width: 100%; height: 100%; }
-#tuanjie-canvas { width: 100%; height: 100%; background: url('bg.jpg') no-repeat center; background-size: cover; }
-#tuanjie-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
-#tuanjie-progress-bar-empty { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center }
-#tuanjie-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
-#tuanjie-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
+#unity-container { position: fixed; width: 100%; height: 100%; }
+#unity-canvas { width: 100%; height: 100%; background:  url('bg.jpg') no-repeat center; background-size: cover; }
+#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
+#unity-progress-bar-empty { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center }
+#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
+#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

BIN
game/public/unity/antibody-battle/TemplateData/webmemd-icon.png


+ 42 - 31
game/public/unity/antibody-battle/index.html

@@ -6,20 +6,23 @@
     <title>抗体大作战</title>
     <link rel="shortcut icon" href="TemplateData/favicon.ico">
     <link rel="stylesheet" href="TemplateData/style.css">
-    <link rel="manifest" href="manifest.webmanifest">
   </head>
   <body>
-    <div id="tuanjie-container">
-      <canvas id="tuanjie-canvas" width=960 height=600 tabindex="-1"></canvas>
-      <div id="tuanjie-loading-bar">
-        <div id="tuanjie-logo"></div>
-        <div id="tuanjie-progress-bar-empty">
-          <div id="tuanjie-progress-bar-full"></div>
+    <div id="unity-container" class="unity-desktop">
+      <canvas id="unity-canvas" tabindex="-1"></canvas>
+      <div id="unity-loading-bar">
+        <div id="unity-progress-bar-empty">
+          <div id="unity-progress-bar-full"></div>
         </div>
       </div>
-      <div id="tuanjie-warning"> </div>
+      <div id="unity-warning"> </div>
+      <div id="unity-footer">
+        <div id="unity-fullscreen-button"></div>
+        <div id="unity-build-title">抗体大作战</div>
+      </div>
     </div>
     <script>
+
 	  window.getQueryVariable = function getQueryVariable(variable) {
 		var query = window.location.search.substring(1);
 		var vars = query.split("&");
@@ -31,19 +34,13 @@
 		}
 		return false;
 		}
-
-	
-      window.addEventListener("load", function () {
-        if ("serviceWorker" in navigator) {
-          navigator.serviceWorker.register("ServiceWorker.js");
-        }
-      });
-
-      var container = document.querySelector("#tuanjie-container");
-      var canvas = document.querySelector("#tuanjie-canvas");
-      var loadingBar = document.querySelector("#tuanjie-loading-bar");
-      var progressBarFull = document.querySelector("#tuanjie-progress-bar-full");
-      var warningBanner = document.querySelector("#tuanjie-warning");
+		
+      var container = document.querySelector("#unity-container");
+      var canvas = document.querySelector("#unity-canvas");
+      var loadingBar = document.querySelector("#unity-loading-bar");
+      var progressBarFull = document.querySelector("#unity-progress-bar-full");
+      var fullscreenButton = document.querySelector("#unity-fullscreen-button");
+      var warningBanner = document.querySelector("#unity-warning");
 
       // Shows a temporary message banner/ribbon for a few seconds, or
       // a permanent error message on top of the canvas if type=='error'.
@@ -77,12 +74,12 @@
         codeUrl: buildUrl + "/Build.wasm.unityweb",
         streamingAssetsUrl: "StreamingAssets",
         companyName: "4dage",
-        productName: "VirusWar",
-        productVersion: "0.1.0",
+        productName: "抗体大作战",
+        productVersion: "0.1.2",
         showBanner: unityShowBanner,
       };
 
-      // By default Tuanjie keeps WebGL canvas render target size matched with
+      // By default, Unity keeps WebGL canvas render target size matched with
       // the DOM size of the canvas element (scaled by window.devicePixelRatio)
       // Set this to false if you want to decouple this synchronization from
       // happening inside the engine, and you would instead like to size up
@@ -91,10 +88,19 @@
 
       if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
         // Mobile device style: fill the whole browser client area with the game canvas:
+
         var meta = document.createElement('meta');
         meta.name = 'viewport';
         meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
         document.getElementsByTagName('head')[0].appendChild(meta);
+        container.className = "unity-mobile";
+        canvas.className = "unity-mobile";
+
+        // To lower canvas resolution on mobile devices to gain some
+        // performance, uncomment the following line:
+        // config.devicePixelRatio = 1;
+
+
       }
 
       loadingBar.style.display = "block";
@@ -102,15 +108,20 @@
       var script = document.createElement("script");
       script.src = loaderUrl;
       script.onload = () => {
-        createTuanjieInstance(canvas, config, (progress) => {
+        createUnityInstance(canvas, config, (progress) => {
           progressBarFull.style.width = 100 * progress + "%";
-        }).then((tuanjieInstance) => {
-          loadingBar.style.display = "none";
-        }).catch((message) => {
-          alert(message);
-        });
-      };
+              }).then((unityInstance) => {
+                loadingBar.style.display = "none";
+                fullscreenButton.onclick = () => {
+                  unityInstance.SetFullscreen(1);
+                };
+              }).catch((message) => {
+                alert(message);
+              });
+            };
+
       document.body.appendChild(script);
+
     </script>
   </body>
 </html>

+ 0 - 15
game/public/unity/antibody-battle/manifest.webmanifest

@@ -1,15 +0,0 @@
-{
-    "name": "VirusWar",
-    "short_name": "VirusWar",
-    "start_url": "index.html",
-    "display": "fullscreen",
-    "background_color": "#231F20",
-    "theme_color": "#000",
-    "description": "",
-    "icons": [{
-      "src": "TemplateData/icons/tuanjie-logo-dark.png",
-      "sizes": "144x144",
-      "type": "image/png",
-      "purpose": "any maskable"
-    }]
-  }

BIN
game/public/unity/disaster-relief/Build/Build.data.unityweb


BIN
game/public/unity/disaster-relief/Build/Build.framework.js.unityweb


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
game/public/unity/disaster-relief/Build/Build.loader.js


BIN
game/public/unity/disaster-relief/Build/Build.wasm.unityweb


BIN
game/public/unity/enviroment-protection/Build/Build.data.unityweb


BIN
game/public/unity/enviroment-protection/Build/Build.framework.js.unityweb


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
game/public/unity/enviroment-protection/Build/Build.loader.js


BIN
game/public/unity/enviroment-protection/Build/Build.wasm.unityweb


+ 0 - 33
game/public/unity/enviroment-protection/ServiceWorker.js

@@ -1,33 +0,0 @@
-const cacheName = "4dage-EcologicalProtection-0.1.0";
-const contentToCache = [
-    "Build/Build.loader.js",
-    "Build/Build.framework.js.unityweb",
-    "Build/Build.data.unityweb",
-    "Build/Build.wasm.unityweb",
-    "TemplateData/style.css"
-
-];
-
-self.addEventListener('install', function (e) {
-    console.log('[Service Worker] Install');
-    
-    e.waitUntil((async function () {
-      const cache = await caches.open(cacheName);
-      console.log('[Service Worker] Caching all: app shell and content');
-      await cache.addAll(contentToCache);
-    })());
-});
-
-self.addEventListener('fetch', function (e) {
-    e.respondWith((async function () {
-      let response = await caches.match(e.request);
-      console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
-      if (response) { return response; }
-
-      response = await fetch(e.request);
-      const cache = await caches.open(cacheName);
-      console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
-      cache.put(e.request, response.clone());
-      return response;
-    })());
-});

+ 6 - 6
game/public/unity/enviroment-protection/TemplateData/style.css

@@ -1,7 +1,7 @@
 body { padding: 0; margin: 0 }
-#tuanjie-container { position: fixed; width: 100%; height: 100%; }
-#tuanjie-canvas { width: 100%; height: 100%; background: url('bg.jpg') no-repeat center; background-size: cover; }
-#tuanjie-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
-#tuanjie-progress-bar-empty { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center }
-#tuanjie-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
-#tuanjie-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
+#unity-container { position: fixed; width: 100%; height: 100%; }
+#unity-canvas { width: 100%; height: 100%; background:  url('bg.jpg') no-repeat center; background-size: cover; }
+#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
+#unity-progress-bar-empty { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center }
+#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
+#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

BIN
game/public/unity/enviroment-protection/TemplateData/webmemd-icon.png


+ 42 - 31
game/public/unity/enviroment-protection/index.html

@@ -6,20 +6,23 @@
     <title>生态保护</title>
     <link rel="shortcut icon" href="TemplateData/favicon.ico">
     <link rel="stylesheet" href="TemplateData/style.css">
-    <link rel="manifest" href="manifest.webmanifest">
   </head>
   <body>
-    <div id="tuanjie-container">
-      <canvas id="tuanjie-canvas" width=960 height=600 tabindex="-1"></canvas>
-      <div id="tuanjie-loading-bar">
-        <div id="tuanjie-logo"></div>
-        <div id="tuanjie-progress-bar-empty">
-          <div id="tuanjie-progress-bar-full"></div>
+    <div id="unity-container" class="unity-desktop">
+      <canvas id="unity-canvas" tabindex="-1"></canvas>
+      <div id="unity-loading-bar">
+        <div id="unity-progress-bar-empty">
+          <div id="unity-progress-bar-full"></div>
         </div>
       </div>
-      <div id="tuanjie-warning"> </div>
+      <div id="unity-warning"> </div>
+      <div id="unity-footer">
+        <div id="unity-fullscreen-button"></div>
+        <div id="unity-build-title">生态保护</div>
+      </div>
     </div>
     <script>
+
 	  window.getQueryVariable = function getQueryVariable(variable) {
 		var query = window.location.search.substring(1);
 		var vars = query.split("&");
@@ -31,19 +34,13 @@
 		}
 		return false;
 		}
-
-	
-      window.addEventListener("load", function () {
-        if ("serviceWorker" in navigator) {
-          navigator.serviceWorker.register("ServiceWorker.js");
-        }
-      });
-
-      var container = document.querySelector("#tuanjie-container");
-      var canvas = document.querySelector("#tuanjie-canvas");
-      var loadingBar = document.querySelector("#tuanjie-loading-bar");
-      var progressBarFull = document.querySelector("#tuanjie-progress-bar-full");
-      var warningBanner = document.querySelector("#tuanjie-warning");
+		
+      var container = document.querySelector("#unity-container");
+      var canvas = document.querySelector("#unity-canvas");
+      var loadingBar = document.querySelector("#unity-loading-bar");
+      var progressBarFull = document.querySelector("#unity-progress-bar-full");
+      var fullscreenButton = document.querySelector("#unity-fullscreen-button");
+      var warningBanner = document.querySelector("#unity-warning");
 
       // Shows a temporary message banner/ribbon for a few seconds, or
       // a permanent error message on top of the canvas if type=='error'.
@@ -77,12 +74,12 @@
         codeUrl: buildUrl + "/Build.wasm.unityweb",
         streamingAssetsUrl: "StreamingAssets",
         companyName: "4dage",
-        productName: "EcologicalProtection",
-        productVersion: "0.1.0",
+        productName: "生态保护",
+        productVersion: "0.1.2",
         showBanner: unityShowBanner,
       };
 
-      // By default Tuanjie keeps WebGL canvas render target size matched with
+      // By default, Unity keeps WebGL canvas render target size matched with
       // the DOM size of the canvas element (scaled by window.devicePixelRatio)
       // Set this to false if you want to decouple this synchronization from
       // happening inside the engine, and you would instead like to size up
@@ -91,10 +88,19 @@
 
       if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
         // Mobile device style: fill the whole browser client area with the game canvas:
+
         var meta = document.createElement('meta');
         meta.name = 'viewport';
         meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
         document.getElementsByTagName('head')[0].appendChild(meta);
+        container.className = "unity-mobile";
+        canvas.className = "unity-mobile";
+
+        // To lower canvas resolution on mobile devices to gain some
+        // performance, uncomment the following line:
+        // config.devicePixelRatio = 1;
+
+
       }
 
       loadingBar.style.display = "block";
@@ -102,15 +108,20 @@
       var script = document.createElement("script");
       script.src = loaderUrl;
       script.onload = () => {
-        createTuanjieInstance(canvas, config, (progress) => {
+        createUnityInstance(canvas, config, (progress) => {
           progressBarFull.style.width = 100 * progress + "%";
-        }).then((tuanjieInstance) => {
-          loadingBar.style.display = "none";
-        }).catch((message) => {
-          alert(message);
-        });
-      };
+              }).then((unityInstance) => {
+                loadingBar.style.display = "none";
+                fullscreenButton.onclick = () => {
+                  unityInstance.SetFullscreen(1);
+                };
+              }).catch((message) => {
+                alert(message);
+              });
+            };
+
       document.body.appendChild(script);
+
     </script>
   </body>
 </html>

+ 0 - 15
game/public/unity/enviroment-protection/manifest.webmanifest

@@ -1,15 +0,0 @@
-{
-    "name": "EcologicalProtection",
-    "short_name": "EcologicalProtection",
-    "start_url": "index.html",
-    "display": "fullscreen",
-    "background_color": "#231F20",
-    "theme_color": "#000",
-    "description": "",
-    "icons": [{
-      "src": "TemplateData/icons/tuanjie-logo-dark.png",
-      "sizes": "144x144",
-      "type": "image/png",
-      "purpose": "any maskable"
-    }]
-  }

BIN
game/public/unity/lost-children/Build/H5Game-ChinaSecuritiesMuseumMaze.data.unityweb


BIN
game/public/unity/lost-children/Build/H5Game-ChinaSecuritiesMuseumMaze.framework.js.unityweb


BIN
game/public/unity/lost-children/Build/H5Game-ChinaSecuritiesMuseumMaze.wasm.unityweb


BIN
game/public/unity/lost-children/Build/寻找丢失儿童.data.unityweb


BIN
game/public/unity/lost-children/Build/寻找丢失儿童.framework.js.unityweb


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
game/public/unity/lost-children/Build/寻找丢失儿童.loader.js


BIN
game/public/unity/lost-children/Build/寻找丢失儿童.wasm.unityweb


+ 0 - 33
game/public/unity/lost-children/ServiceWorker.js

@@ -1,33 +0,0 @@
-const cacheName = "4dkk-Maze-0.1";
-const contentToCache = [
-    "Build/H5Game-ChinaSecuritiesMuseumMaze.loader.js",
-    "Build/H5Game-ChinaSecuritiesMuseumMaze.framework.js.unityweb",
-    "Build/H5Game-ChinaSecuritiesMuseumMaze.data.unityweb",
-    "Build/H5Game-ChinaSecuritiesMuseumMaze.wasm.unityweb",
-    "TemplateData/style.css"
-
-];
-
-self.addEventListener('install', function (e) {
-    console.log('[Service Worker] Install');
-    
-    e.waitUntil((async function () {
-      const cache = await caches.open(cacheName);
-      console.log('[Service Worker] Caching all: app shell and content');
-      await cache.addAll(contentToCache);
-    })());
-});
-
-self.addEventListener('fetch', function (e) {
-    e.respondWith((async function () {
-      let response = await caches.match(e.request);
-      console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
-      if (response) { return response; }
-
-      response = await fetch(e.request);
-      const cache = await caches.open(cacheName);
-      console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
-      cache.put(e.request, response.clone());
-      return response;
-    })());
-});

BIN
game/public/unity/lost-children/TemplateData/icons/unity-logo-dark.png


BIN
game/public/unity/lost-children/TemplateData/icons/unity-logo-light.png


+ 1 - 5
game/public/unity/lost-children/TemplateData/style.css

@@ -1,11 +1,7 @@
 body { padding: 0; margin: 0 }
 #unity-container { position: fixed; width: 100%; height: 100%; }
-#unity-canvas { width: 100%;
-    height: 100%;
-    background: url('bg.jpg') no-repeat center;
-    background-size: cover; }
+#unity-canvas { width: 100%; height: 100%; background:  url('bg.jpg') no-repeat center; background-size: cover; }
 #unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
-/*#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }*/
 #unity-progress-bar-empty { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center }
 #unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
 #unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

BIN
game/public/unity/lost-children/TemplateData/unity-logo-dark.png


BIN
game/public/unity/lost-children/TemplateData/unity-logo-light.png


BIN
game/public/unity/lost-children/TemplateData/webmemd-icon.png


+ 41 - 18
game/public/unity/lost-children/index.html

@@ -3,34 +3,43 @@
   <head>
     <meta charset="utf-8">
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>找回走失儿童</title>
+    <title>Maze</title>
     <link rel="shortcut icon" href="TemplateData/favicon.ico">
     <link rel="stylesheet" href="TemplateData/style.css">
-    <link rel="manifest" href="manifest.webmanifest">
   </head>
   <body>
-    <div id="unity-container">
-      <canvas id="unity-canvas" width=960 height=600 tabindex="-1"></canvas>
+    <div id="unity-container" class="unity-desktop">
+      <canvas id="unity-canvas" tabindex="-1"></canvas>
       <div id="unity-loading-bar">
-        <div id="unity-logo"></div>
         <div id="unity-progress-bar-empty">
           <div id="unity-progress-bar-full"></div>
         </div>
       </div>
       <div id="unity-warning"> </div>
+      <div id="unity-footer">
+        <div id="unity-fullscreen-button"></div>
+        <div id="unity-build-title">Maze</div>
+      </div>
     </div>
-    <script src="unity.js"></script>
     <script>
-      window.addEventListener("load", function () {
-        if ("serviceWorker" in navigator) {
-          navigator.serviceWorker.register("ServiceWorker.js");
-        }
-      });
 
+	  window.getQueryVariable = function getQueryVariable(variable) {
+		var query = window.location.search.substring(1);
+		var vars = query.split("&");
+		for (var i = 0; i < vars.length; i++) {
+			var pair = vars[i].split("=");
+			if (pair[0] == variable) {
+				return pair[1];
+			}
+		}
+		return false;
+		}
+		
       var container = document.querySelector("#unity-container");
       var canvas = document.querySelector("#unity-canvas");
       var loadingBar = document.querySelector("#unity-loading-bar");
       var progressBarFull = document.querySelector("#unity-progress-bar-full");
+      var fullscreenButton = document.querySelector("#unity-fullscreen-button");
       var warningBanner = document.querySelector("#unity-warning");
 
       // Shows a temporary message banner/ribbon for a few seconds, or
@@ -70,7 +79,7 @@
         showBanner: unityShowBanner,
       };
 
-      // By default Unity keeps WebGL canvas render target size matched with
+      // By default, Unity keeps WebGL canvas render target size matched with
       // the DOM size of the canvas element (scaled by window.devicePixelRatio)
       // Set this to false if you want to decouple this synchronization from
       // happening inside the engine, and you would instead like to size up
@@ -79,10 +88,19 @@
 
       if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
         // Mobile device style: fill the whole browser client area with the game canvas:
+
         var meta = document.createElement('meta');
         meta.name = 'viewport';
         meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
         document.getElementsByTagName('head')[0].appendChild(meta);
+        container.className = "unity-mobile";
+        canvas.className = "unity-mobile";
+
+        // To lower canvas resolution on mobile devices to gain some
+        // performance, uncomment the following line:
+        // config.devicePixelRatio = 1;
+
+
       }
 
       loadingBar.style.display = "block";
@@ -92,13 +110,18 @@
       script.onload = () => {
         createUnityInstance(canvas, config, (progress) => {
           progressBarFull.style.width = 100 * progress + "%";
-        }).then((unityInstance) => {
-          loadingBar.style.display = "none";
-        }).catch((message) => {
-          alert(message);
-        });
-      };
+              }).then((unityInstance) => {
+                loadingBar.style.display = "none";
+                fullscreenButton.onclick = () => {
+                  unityInstance.SetFullscreen(1);
+                };
+              }).catch((message) => {
+                alert(message);
+              });
+            };
+
       document.body.appendChild(script);
+
     </script>
   </body>
 </html>

+ 0 - 15
game/public/unity/lost-children/manifest.webmanifest

@@ -1,15 +0,0 @@
-{
-    "name": {{{ JSON.stringify(PRODUCT_NAME) }}},
-    "short_name": {{{ JSON.stringify(PRODUCT_NAME) }}},
-    "start_url": "index.html",
-    "display": "fullscreen",
-    "background_color": "{{{ BACKGROUND_COLOR }}}",
-    "theme_color": "{{{  SPLASH_SCREEN_STYLE.toLowerCase() === 'light' ? '#fff' : '#000' }}}",
-    "description": {{{ JSON.stringify(PRODUCT_DESCRIPTION) }}},
-    "icons": [{
-      "src": "TemplateData/icons/unity-logo-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png",
-      "sizes": "144x144",
-      "type": "image/png",
-      "purpose": "any maskable"
-    }]
-  }

+ 0 - 12
game/public/unity/lost-children/unity.js

@@ -1,12 +0,0 @@
-
-function getQueryVariable(variable) {
-	var query = window.location.search.substring(1);
-	var vars = query.split("&");
-	for (var i = 0; i < vars.length; i++) {
-		var pair = vars[i].split("=");
-		if (pair[0] == variable) {
-			return pair[1];
-		}
-	}
-	return false;
-}

+ 2 - 1
game/src/api.js

@@ -193,7 +193,7 @@ export async function getScore() {
     return res.data.data
   }
 }
-export async function addScore(score) {
+export async function addScore(score, description) {
   const scoreEncrypted = encodeStr(Base64.encode(score))
   const res = await axios({
     method: 'post',
@@ -202,6 +202,7 @@ export async function addScore(score) {
       score: scoreEncrypted,
       type: '玩游戏',
       userId: store.state.userInfo.id,
+      description,
     },
     headers: {
       token: store.state.token,

+ 1 - 1
game/src/views/ExamPaper2.vue

@@ -263,7 +263,7 @@ function onClickNext() {
     selectedIdx.value = null
   } else {
     if (store.state.loginStatus && !store.state.ifScoreLimitReached && bonusPoint.value !== 0) {
-      addScore(bonusPoint.value).then(() => {
+      addScore(bonusPoint.value, '助农课堂').then(() => {
         getScore().then((res) => {
           store.commit('setScore', res.total)
           store.commit('setIfScoreLimitReached', res.hasOver)

+ 1 - 1
game/src/views/PairUp.vue

@@ -196,7 +196,7 @@ function replay() {
 watch(isOver, (vNew) => {
   if (vNew) {
     if (store.state.loginStatus && !store.state.ifScoreLimitReached && bonusPoint.value !== 0) {
-      addScore(bonusPoint.value).then(() => {
+      addScore(bonusPoint.value, '企业翻翻看').then(() => {
         getScore().then((res) => {
           store.commit('setScore', res.total)
           store.commit('setIfScoreLimitReached', res.hasOver)

+ 1 - 1
game/src/views/PlantTree.vue

@@ -263,7 +263,7 @@ watch(isOver, (vNew) => {
   if (vNew) {
     localStorage.setItem(`plant-tree-last-time-${store.state.token}`, (new Date()).getTime())
     if (store.state.loginStatus && !store.state.ifScoreLimitReached && bonusPoint.value !== 0) {
-      addScore(bonusPoint.value).then(() => {
+      addScore(bonusPoint.value, '乡村林场').then(() => {
         getScore().then((res) => {
           store.commit('setScore', res.total)
           store.commit('setIfScoreLimitReached', res.hasOver)

+ 1 - 1
game/src/views/ShopView.vue

@@ -126,7 +126,7 @@
               {{ recordItem.type }}
             </div>
             <div class="time">
-              {{ recordItem.updateTime }}
+              {{ recordItem.updateTime }} {{ recordItem.description }}
             </div>
           </div>
           <div