From beb96905e5fb27313e577bcf33c95e5a1de7c82d Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Fri, 12 Nov 2021 14:39:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8F=90=E7=A4=BA=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/lesson3d/lesson3dplayer.js | 10 +++++-- .../lesson3d/manager/animatemanager.js | 11 ++++--- .../lesson3d/manager/controlmanager.js | 8 +++++- .../lesson3d/toolsmodel/bagitemdata.js | 18 ++++++++++++ .../lesson3dedit/toolsmodel/bagitemdata.js | 18 ++++++++++++ .../jlmap3d/lesson3dedit/tools/toolbar.vue | 7 +++-- .../jlmap3d/lesson3dplayer/tools/jobpane.vue | 7 +++-- .../jlmap3d/lesson3dplayer/tools/toolbar.vue | 27 ++++++++++++++---- static/lesson3d/audio/err.wav | Bin 0 -> 44044 bytes static/lesson3d/audio/next.wav | Bin 0 -> 244078 bytes static/lesson3d/audio/pbm.wav | Bin 0 -> 668106 bytes static/lesson3d/item/pbmys.png | Bin 0 -> 15347 bytes 12 files changed, 85 insertions(+), 21 deletions(-) create mode 100644 src/jlmap3d/lesson3d/toolsmodel/bagitemdata.js create mode 100644 src/jlmap3d/lesson3dedit/toolsmodel/bagitemdata.js create mode 100644 static/lesson3d/audio/err.wav create mode 100644 static/lesson3d/audio/next.wav create mode 100644 static/lesson3d/audio/pbm.wav create mode 100644 static/lesson3d/item/pbmys.png diff --git a/src/jlmap3d/lesson3d/lesson3dplayer.js b/src/jlmap3d/lesson3d/lesson3dplayer.js index c9f2fc98b..87f7f879b 100644 --- a/src/jlmap3d/lesson3d/lesson3dplayer.js +++ b/src/jlmap3d/lesson3d/lesson3dplayer.js @@ -53,6 +53,10 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) { // let fire = new Fire(); // fire.init(scene); + var audionext = JL3D_LOCAL_STATIC+'/lesson3d/audio/next.wav'; + audionext = new Audio(audionext); + + let animateManager = new AnimateManager(); @@ -65,7 +69,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) { scope.nowSceneType = lessonData.lessonProgress[0].progressScene; animateManager.initAnimation(assetModelManager); - console.log(lessonData.trainDeviceData); + // console.log(lessonData.trainDeviceData); controlManager.init(animateManager.actions,assetModelManager,lessonData.trainDeviceData); startLesson(); @@ -88,6 +92,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) { }else if(actionType == "changeIndex"){ actionModel.visible = true; assetModelManager.otherModel.add(actionModel); + audionext.play(); } } @@ -98,14 +103,13 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) { this.changeIndex = function(nowIndex){ if(nowIndex!=0){ + audionext.play(); oldIndex = lessonIndex; if(lessonData.lessonProgress[oldIndex].roleName == nowRole){ updateExam(lessonData.lessonProgress[oldIndex],oldIndex); } } - - lessonIndex = nowIndex; // console.log(nowIndex); diff --git a/src/jlmap3d/lesson3d/manager/animatemanager.js b/src/jlmap3d/lesson3d/manager/animatemanager.js index e566dba48..28803d4e3 100644 --- a/src/jlmap3d/lesson3d/manager/animatemanager.js +++ b/src/jlmap3d/lesson3d/manager/animatemanager.js @@ -22,8 +22,8 @@ export function AnimateManager() { for(let i=0;i =0;i--){ if(mixers[i]._actions[0].isRunning()){ mixers[i].update( mixerUpdateDelta ); diff --git a/src/jlmap3d/lesson3d/manager/controlmanager.js b/src/jlmap3d/lesson3d/manager/controlmanager.js index ba58aba26..dfa4e72a6 100644 --- a/src/jlmap3d/lesson3d/manager/controlmanager.js +++ b/src/jlmap3d/lesson3d/manager/controlmanager.js @@ -29,6 +29,9 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { let trainDeviceMode = false; let trainDeviceList = []; + var audiopbm = JL3D_LOCAL_STATIC+'/lesson3d/audio/pbm.wav'; + audiopbm = new Audio(audiopbm); + let renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setClearColor(new THREE.Color(0x000000)); renderer.setViewport( 0, 0, dom.offsetWidth, dom.offsetHeight); @@ -130,7 +133,6 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { this.initRoleMode = function(rMode,role){ roleMode = rMode; nowRole = role; - // console.log(roleMode); }; this.initExam = function(newExamList,newExamData){ @@ -297,6 +299,10 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { actionEvent("remove",raycasterBoxs[i],raycasterBoxs[i].mesh); jumpEvent("action",raycasterBoxs[i]); }else if(raycasterBoxs[i].actionMode == "play"){ + // console.log(raycasterBoxs[i]); + if(raycasterBoxs[i].action.actionType == "PBMDH"){ + audiopbm.play(); + } if(raycasterBoxs[i].animateModel != "播放动画的模型"){ if(raycasterBoxs[i].action.status == "01"){ raycasterBoxs[i].action.status = "02"; diff --git a/src/jlmap3d/lesson3d/toolsmodel/bagitemdata.js b/src/jlmap3d/lesson3d/toolsmodel/bagitemdata.js new file mode 100644 index 000000000..e896c9cc9 --- /dev/null +++ b/src/jlmap3d/lesson3d/toolsmodel/bagitemdata.js @@ -0,0 +1,18 @@ +import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; + +export function BagItemData() { + let scope = this; + + this.dataList = []; + + scope.dataList["ztg"] = [ + { + id:"pbmys", + name:"屏蔽门钥匙", + type:"equip", + pic:JL3D_LOCAL_STATIC+"/lesson3d/item/pbmys.png", + status:false, + }, + ]; + +} diff --git a/src/jlmap3d/lesson3dedit/toolsmodel/bagitemdata.js b/src/jlmap3d/lesson3dedit/toolsmodel/bagitemdata.js new file mode 100644 index 000000000..e896c9cc9 --- /dev/null +++ b/src/jlmap3d/lesson3dedit/toolsmodel/bagitemdata.js @@ -0,0 +1,18 @@ +import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; + +export function BagItemData() { + let scope = this; + + this.dataList = []; + + scope.dataList["ztg"] = [ + { + id:"pbmys", + name:"屏蔽门钥匙", + type:"equip", + pic:JL3D_LOCAL_STATIC+"/lesson3d/item/pbmys.png", + status:false, + }, + ]; + +} diff --git a/src/views/jlmap3d/lesson3dedit/tools/toolbar.vue b/src/views/jlmap3d/lesson3dedit/tools/toolbar.vue index 5d20efe02..9c495bdbe 100644 --- a/src/views/jlmap3d/lesson3dedit/tools/toolbar.vue +++ b/src/views/jlmap3d/lesson3dedit/tools/toolbar.vue @@ -1,13 +1,14 @@