Преглед на файлове

fix:之前的游戏文件放错了,放成移动端的了

任一存 преди 1 година
родител
ревизия
d05132b69b

BIN
public/game/Build/Build.data.unityweb


BIN
public/game/Build/Build.framework.js.unityweb


BIN
public/game/Build/Build.wasm.unityweb


+ 1 - 1
public/game/ServiceWorker.js

@@ -1,4 +1,4 @@
-const cacheName = "4Dage-H5Game-NanjingMuseum-1.1.2";
+const cacheName = "4Dage-H5Game-NanjingMuseum-1.0.4";
 const contentToCache = [
     "Build/Build.loader.js",
     "Build/Build.framework.js.unityweb",

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
public/game/StreamingAssets/aa/catalog.json


BIN
public/game/TemplateData/img_paper.png


+ 6 - 2
public/game/index.css

@@ -30,6 +30,10 @@
     position: absolute;
 }
 
+#unity-loading-brush {
+    position: absolute;
+}
+
 #unity-loading-bg {
     position: absolute;
     object-fit: cover;
@@ -46,8 +50,8 @@
 
 #unity-loading-progress{
     position: absolute;
-    width: 30vw;
-    height: 30vw;
+    width: 30vh;
+    height: 30vh;
 }
 
 #unity-loading-progress-text{

+ 34 - 15
public/game/index.html

@@ -14,17 +14,15 @@
       <canvas id="unity-canvas" tabindex="-1"></canvas>
 
       <div id="unity-loading">
-        <img id="unity-loading-bg" src="./TemplateData/img_bg.jpg" alt="" />
+        <img id="unity-loading-bg" src="./TemplateData/bg_game.png" alt="" />
         <img id="unity-loading-paper" src="./TemplateData/img_paper.png" alt="" />
+        <img id="unity-loading-brush" src="./TemplateData/img_brush.png" alt="" />
         <img id="unity-loading-progress" src="./TemplateData/progress.png" alt="" />
         <span id="unity-loading-progress-text"></span>
       </div>
       
       <div id="unity-warning"> </div>
     </div>
-    <div class="save-image-block">
-      <img src="" class="save-image-backgroup" alt="">
-    </div>
     <script>
       window.addEventListener("load", function () {
         if ("serviceWorker" in navigator) {
@@ -70,7 +68,7 @@
         streamingAssetsUrl: "StreamingAssets",
         companyName: "4Dage",
         productName: "H5Game-NanjingMuseum",
-        productVersion: "1.1.2",
+        productVersion: "1.0.4",
         showBanner: unityShowBanner,
       };
 
@@ -93,6 +91,7 @@
       let isShowLoading = true;
       const loadingDom = document.querySelector('#unity-loading');
       const loadingPaperDom = document.querySelector('#unity-loading-paper');
+      const loadingBrushDom = document.querySelector('#unity-loading-brush');
       const loadingBgDom = document.querySelector('#unity-loading-bg');
       const progressDom = document.querySelector('#unity-loading-progress');
       const progressText = document.querySelector('#unity-loading-progress-text');
@@ -105,6 +104,7 @@
             opacity = opacity - 0.05;
             progressDom.style.opacity = opacity;
             loadingPaperDom.style.opacity = opacity;
+            loadingBrushDom.style.opacity = opacity;
             loadingBgDom.style.opacity = opacity;
             fadeOutVideo();
           }, 20)
@@ -130,14 +130,19 @@
 
       function refreshLoadingPaperBlockSize() {
         // Unity画布宽高比
-        const unityCanvasWidth = 1560;
-        const unityCanvasHeight = 3376;
-
-        const unityPanelWidth = 1560;
-        const unityPanelHeight = 3301;
-        const unityPanelOffsetY = 97.5;
-        const unityPanelOffsetX = -34;
-
+        const unityCanvasWidth = 1920;
+        const unityCanvasHeight = 1080;
+
+        const unityPanelWidth = 650;
+        const unityPanelHeight = 1098;
+        const unityPanelOffsetY = 35;
+        const unityPanelOffsetX = 0;
+
+        const unityPanelBrushWidth = 462;
+        const unityPanelBrushHeight = 608;
+        const unityPanelBrushOffsetY = -115;
+        const unityPanelBrushOffsetX = 555;
+        
         const innerWidth = window.innerWidth;
         const innerHeight = window.innerHeight;
 
@@ -146,18 +151,32 @@
 
         loadingPaperDom.style.width = (unityPanelWidth * scale) + 'px';
         loadingPaperDom.style.height = (unityPanelHeight * scale) + 'px';
+        loadingBrushDom.style.width = (unityPanelBrushWidth * scale) + 'px';
+        loadingBrushDom.style.height = (unityPanelBrushHeight * scale) + 'px';
 
-        if (unityPanelOffsetY > 0){
+        if (unityPanelOffsetY > 0) {
           loadingPaperDom.style.marginTop = (unityPanelOffsetY * scale * 2) + 'px';
         } else {
           loadingPaperDom.style.marginBottom = (-unityPanelOffsetY * scale * 2) + 'px';
         }
 
-        if (unityPanelOffsetX > 0){
+        if (unityPanelOffsetX > 0) {
           loadingPaperDom.style.marginLeft = (unityPanelOffsetX * scale * 2) + 'px';
         } else {
           loadingPaperDom.style.marginRight = (-unityPanelOffsetX * scale * 2) + 'px';
         }
+
+        if (unityPanelBrushOffsetY > 0) {
+          loadingBrushDom.style.marginTop = (unityPanelBrushOffsetY * scale * 2) + 'px';
+        } else {
+          loadingBrushDom.style.marginBottom = (-unityPanelBrushOffsetY * scale * 2) + 'px';
+        }
+
+        if (unityPanelBrushOffsetX > 0) {
+          loadingBrushDom.style.marginLeft = (unityPanelBrushOffsetX * scale * 2) + 'px';
+        } else {
+          loadingBrushDom.style.marginRight = (-unityPanelBrushOffsetX * scale * 2) + 'px';
+        }
       }
 
       refreshLoadingPaperBlockSize();

+ 5 - 46
public/game/index.js

@@ -1,11 +1,8 @@
-const saveDom = document.querySelector('.save-image-backgroup');
-let isShowSaveDom = false;
-
-window.updateTexture = function (title, base64string) {
-    saveDom.src = 'data:image/png;base64,' + base64string;
-    isShowSaveDom = true;
-    saveDom.style.pointerEvents = 'auto';
-    refreshShareBlockSize();
+window.downloadTexture = function (base64string) {
+    let link = document.createElement('a');
+    link.href = 'data:image/png;base64,' + base64string;
+    link.download = 'image';
+    link.click();
 }
 
 window.gameInitialized = function () {
@@ -19,41 +16,3 @@ window.closePanel = function () {
     isShowSaveDom = false;
     saveDom.style.pointerEvents = 'none';
 }
-
-window.clickEdit = function () {
-    window.parent?.isShowToastFromGame()
-}
-
-// 提供给父页面点击保存按钮使用
-window.saveTitle = function(msg) {
-    window.unityInstance.SendMessage('WebEvent', 'UpdateTextureContent', msg)
-}
-
-function refreshShareBlockSize() {
-
-    // Unity画布宽高比
-    let unityCanvasWidth = 1560;
-    let unityCanvaslHeight = 3376;
-    let unityPanelWidth = 1450;
-    let unityPanelHeight = 2800;
-    let unityPanelOffsetY = -148;
-
-    let innerWidth = window.innerWidth;
-    let innerHeight = window.innerHeight;
-
-    let scale = (unityCanvasWidth / unityPanelHeight) >
-        (innerWidth / innerHeight) ? (innerWidth / unityCanvasWidth) : (innerHeight / unityCanvaslHeight);
-    
-    saveDom.style.width = (unityPanelWidth * scale) + 'px';
-    saveDom.style.height = (unityPanelHeight * scale) + 'px';
-    
-    if (unityPanelOffsetY > 0){
-        saveDom.style.marginTop = (unityPanelOffsetY * scale * 2) + 'px';
-    } else {
-        saveDom.style.marginBottom = (-unityPanelOffsetY * scale * 2) + 'px';
-    }
-}
-
-window.addEventListener('resize', ()=>{
-    if (isShowSaveDom) refreshShareBlockSize();
-});