瀏覽代碼

feat(map): update

gemercheung 1 年之前
父節點
當前提交
1c6d652c37
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      src/core/player/Player.js

+ 7 - 3
src/core/player/Player.js

@@ -574,11 +574,11 @@ export default class Player {
       }
     }
   }
-  deleteItemByType(type, pos) {
+  deleteItemByType(type, data) {
     if (type === 1) {
       const index = this.renderMarkers.findIndex((mk) => {
         const p = new THREE.Vector3().fromArray(mk.point);
-        const v = new THREE.Vector3().fromArray(pos);
+        const v = new THREE.Vector3().fromArray(data);
         return p.equals(v);
       });
       this.renderMarkers.splice(index, 1);
@@ -588,12 +588,16 @@ export default class Player {
     if (type === 3) {
       const index = this.renderSymbols.findIndex((syb) => {
         const p = new THREE.Vector3().fromArray(syb.point);
-        const v = new THREE.Vector3().fromArray(pos);
+        const v = new THREE.Vector3().fromArray(data);
         return p.equals(v);
       });
       this.renderSymbols.splice(index, 1);
     }
     if (type === 4) {
+      const { id } = data;
+      const index = this.renderTexts.findIndex((item) => item.id === id);
+      debugger;
+      this.renderTexts.splice(index, 1);
     }
   }
   editing(item) {