Browse Source

用新版unity代码;带参数id跳转元宇宙界面时focus到对应星球上。

任一存 1 year ago
parent
commit
18da05eb21

BIN
public/unity/Build/SHIndustryMuseum_2.13.data.unityweb


BIN
public/unity/Build/SHIndustryMuseum_2.13.framework.js.unityweb


File diff suppressed because it is too large
+ 1 - 0
public/unity/Build/SHIndustryMuseum_2.13.loader.js


BIN
public/unity/Build/SHIndustryMuseum_2.13.wasm.unityweb


+ 4 - 4
src/App.vue

@@ -210,11 +210,11 @@ export default {
       var canvas = document.querySelector("#unity-canvas")
 
       var buildUrl = "unity/Build"
-      var loaderUrl = buildUrl + "/SHIndustryMuseum_2.12.loader.js"
+      var loaderUrl = buildUrl + "/SHIndustryMuseum_2.13.loader.js"
       var config = {
-        dataUrl: buildUrl + "/SHIndustryMuseum_2.12.data.unityweb",
-        frameworkUrl: buildUrl + "/SHIndustryMuseum_2.12.framework.js.unityweb",
-        codeUrl: buildUrl + "/SHIndustryMuseum_2.12.wasm.unityweb",
+        dataUrl: buildUrl + "/SHIndustryMuseum_2.13.data.unityweb",
+        frameworkUrl: buildUrl + "/SHIndustryMuseum_2.13.framework.js.unityweb",
+        codeUrl: buildUrl + "/SHIndustryMuseum_2.13.wasm.unityweb",
         streamingAssetsUrl: "StreamingAssets",
         companyName: "DefaultCompany",
         productName: "SHIndustryMuseum",

+ 16 - 15
src/views/Metaverse.vue

@@ -186,6 +186,22 @@ export default {
       isShowDesc.value = true
     }
 
+    function focusStar(idx) {
+      desc.name = rawData.value[idx].name
+      desc.detail = rawData.value[idx].description
+      isShowDesc.value = true
+      window.gUnityInst.SendMessage('Page4', 'OnClickPlaneId', idx + 1)
+    }
+    onMounted(async () => {
+      const url = window.location.href
+      if (url.includes('id=')) {
+        const id = url.split('id=')[1]
+        // console.log('ppppppppppppppppp', id)
+        setTimeout(() => {
+          focusStar(Number(id) - 1)
+        }, 400)
+      }
+    })
 
     // 详情数据
     const G4info = ref({
@@ -207,7 +223,6 @@ export default {
     }
 
     window.handleClickPlanet = function (id) {
-
       G4info.value = {
         company: [],
         person: [],
@@ -221,20 +236,6 @@ export default {
       onClickStar(id - 1)
     }
 
-
-    onMounted(async () => {
-      const url = window.location.href
-      if (url.includes('id=')) {
-        const id = url.split('id=')[1]
-        // console.log('ppppppppppppppppp', id)
-        setTimeout(() => {
-          onClickStar(Number(id) - 1)
-        }, 400)
-      }
-    })
-
-
-
     window.handleMovedPlanet = function (id) {
       console.log('moved planet', id)
     }