浏览代码

tip model

zhouenguang 3 年之前
父节点
当前提交
6a2c105f67

dist/assets/avatar/YXTN/body.glb → dist/assets/avatar/YXTN/body - 副本 (2).glb


dist/assets/avatar/YXTN/body - 副本.glb → dist/assets/avatar/YXTN/body0.glb


二进制
dist/assets/avatar/man_YXL/man_YXL - 副本 (2).glb


二进制
dist/assets/avatar/man_YXL/man_YXL - 副本.glb


二进制
dist/assets/avatar/man_YXL/man_YXL.glb


+ 7 - 7
dist/assets/config.json

@@ -7,17 +7,17 @@
                 {
                     "id": "KGe_Boy",
                     "name": "KGe_Boy",
-                    "url": "./assets/avatar/YXTN.zip",
+                    "url": "./assets/avatar/man_YXL.zip",
                     "gender": "man",
                     "components": [],
                     "animations": [
                         {
                             "name": "Walking",
-                            "url": "./assets/avatar/YXTN/animations/Walking.glb"
+                            "url": "./assets/avatar/man_YXL/animations/Walking.glb"
                         },
                         {
                             "name": "Idle",
-                            "url": "./assets/avatar/YXTN/animations/Idle.glb"
+                            "url": "./assets/avatar/man_YXL/animations/Idle.glb"
                         }
                     ]
                 }
@@ -115,7 +115,7 @@
             "assetTotalSize": 24248947,
             "assetUrls": [
                 {
-                    "url": "./assets/avatar/YXTN/component_list.json",
+                    "url": "./assets/avatar/man_YXL/component_list.json",
                     "packName": "",
                     "typeName": "avatar",
                     "className": "",
@@ -123,7 +123,7 @@
                     "size": 14294
                 },
                 {
-                    "url": "./assets/avatar/YXTN/body.glb",
+                    "url": "./assets/avatar/man_YXL/man_YXL.glb",
                     "packName": "",
                     "typeName": "avatar",
                     "className": "",
@@ -131,7 +131,7 @@
                     "size": 137548
                 },
                 {
-                    "url": "./assets/avatar/YXTN/animations/Walking.glb",
+                    "url": "./assets/avatar/man_YXL/animations/Walking.glb",
                     "packName": "",
                     "typeName": "avatar",
                     "className": "",
@@ -139,7 +139,7 @@
                     "size": 99844
                 },
                 {
-                    "url": "./assets/avatar/YXTN/animations/Idle.glb",
+                    "url": "./assets/avatar/man_YXL/animations/Idle.glb",
                     "packName": "",
                     "typeName": "avatar",
                     "className": "",

+ 13 - 0
dist/index.html

@@ -17,6 +17,19 @@
             background-repeat: no-repeat;
             background-size: 600px 600px;
         }
+        .tip {
+            position: absolute;
+            top: 2rem;
+            left: 50%;
+            transform: translateX(-50%);
+            padding: 1rem 1.6rem;
+            background-color: #5bc1d1;
+            color: white;
+            z-index: 9999;
+            border-radius: 0.2rem;
+            opacity: 1;
+            transition: opacity .2s;
+        }
     </style>
 </head>
 <body>

+ 16 - 0
src/Tip.js

@@ -0,0 +1,16 @@
+export default class Tip {
+    constructor(message) {
+        let msgDiv = document.createElement("div")
+        msgDiv.className = "tip"
+        msgDiv.innerHTML = message
+        document.querySelector("#root").appendChild(msgDiv)
+
+        setTimeout(() => {
+            msgDiv.style.opacity = 0
+        }, 4000)
+
+        setTimeout(() => {
+            document.querySelector("#root").removeChild(msgDiv)
+        }, 5000)
+    }
+}

+ 22 - 20
src/main.js

@@ -1,5 +1,6 @@
 import Xverse from "./Xverse.js"
 import Codes from "./enum/Codes.js"
+import Tip from "./Tip.js";
 
 const xverse = new Xverse({
     env: "DEV",
@@ -57,12 +58,13 @@ const l = async()=>{
 
         u();
         c();
-        f();
+        // f();
         
         //e(!1);
     } catch (M) {
+        M = String(M).split(",")[1]
         console.error(M);
-        alert(M);
+        new Tip(M)  // alert(M);
         return
     }
 }
@@ -100,24 +102,24 @@ const c = ()=>{
 }
 
 const f = async ()=>{
-    // const T = (await room.modelManager.findAssetList(String(room.skinId))).filter(E=>E.typeName === "MEDIA").map(E=>E.url);
-    // // a(T),
-    // room.tv && room.tv.setUrl({
-    //     url: "./assets/xverse_tv_840x480_1K.mp4",
-    //     loop: !0
-    // }).then(async()=>{
-    //     try {
-    //         if(room.tv.videoElement) {
-    //             // room.tv.videoElement.muted = false
-    //             await room.tv.videoElement.play()
-    //             console.log("\u64AD\u653E\u6210\u529F")     // 播放成功
-    //         }
-    //     } catch (S) {
-    //         console.log("\u64AD\u653E\u5931\u8D25\uFF1A", S)    // 播放失败
-    //     }
-    // }).catch(E=>{
-    //     console.error(E)
-    // })
+    const T = (await room.modelManager.findAssetList(String(room.skinId))).filter(E=>E.typeName === "MEDIA").map(E=>E.url);
+    // a(T),
+    room.tv && room.tv.setUrl({
+        url: "./assets/xverse_tv_840x480_1K.mp4",
+        loop: !0
+    }).then(async()=>{
+        try {
+            if(room.tv.videoElement) {
+                // room.tv.videoElement.muted = false
+                await room.tv.videoElement.play()
+                console.log("\u64AD\u653E\u6210\u529F")     // 播放成功
+            }
+        } catch (S) {
+            console.log("\u64AD\u653E\u5931\u8D25\uFF1A", S)    // 播放失败
+        }
+    }).catch(E=>{
+        console.error(E)
+    })
 }
 
 l();