人生啊人生 10 miesięcy temu
rodzic
commit
98ea07af8c

+ 74 - 1
src/components/student/ThreeWorldEvent/event/TypeClick.ts

@@ -153,7 +153,32 @@ export class TypeClick {
 
             // 请将水管链接
             case '请将水管链接':
-                
+
+                if (thisClass.meshListBool(type, objMesh.id) == true) {
+                    
+                    // 切换成正在处理中
+                    TypeEvent.find().eventEnd = 1;
+
+                    // 切换视角
+                    objIframeEdit.modelPeopleLook(3);
+                    objIframeEdit.cameraVisualAngleGetListNameGpsTo("卷帘门视角2");
+                    objIframeEdit.roleShow(false);
+
+                    let thisTime = new Date().getTime();
+
+                    ComVal.find().fpsEventAdd("type_click_" + thisTime, {}, 1500, function(fpsEventAddRet : any) {
+                        ComVal.find().fpsEventDel(fpsEventAddRet.code);
+                        thisClass.openShuiGuanLianJie(function() {
+                            
+                            TypeEvent.find().eventEnd = 2;
+                            TypeEvent.find().tipsBtnsUpOpenEventCallbackMain(false);
+                            TypeEvent.find().tipsBtnsDownOpenEventCallbackMain(true);
+
+                        });
+                    });
+
+                }
+                    
                 break;
 
             // 开始清洗
@@ -209,6 +234,11 @@ export class TypeClick {
                 "model_1733539237685卷帘门02-2" : "model_1733539237685卷帘门02-2",
                 "model_1733539237685卷帘门01-3" : "model_1733539237685卷帘门01-3",
             },
+            "请将水管链接" : {
+                "model_1733539237692喷头" : "model_1733539237692喷头",
+                "model_1733539237692水管_primitive0" : "model_1733539237692水管_primitive0",
+                "model_1733539237692水管_primitive1" : "model_1733539237692水管_primitive1",
+            },
             
         };
         
@@ -317,6 +347,49 @@ export class TypeClick {
     }
     
 
+    /**
+     * 水管链接
+     * callback     开启完成回调
+     */
+    openShuiGuanLianJie = (callback : any) => {
+
+        let thisClass = this;
+        let objIframeEdit = this.objIframeEdit;
+        let objIframe = this.objIframe;
+        let objScene = this.objScene;
+        let BABYLON = this.BABYLON;
+        let ChengGuangYuanJing = objIframe.ChengGuangYuanJing;
+
+        // 播放动画列表
+        let playList = [
+            { "name" : "喷头", "speed" : 1, "from" : 380, "to" : 500 },
+            { "name" : "水管", "speed" : 1, "from" : 380, "to" : 500 },
+        ];
+        // 动画播放完成次数
+        let playEndNum = 0;
+        for (let i = 0; i < playList.length; i++) {
+
+            let thisPlayList = playList[i];
+            ChengGuangYuanJing.CommonVal.find().animationGroupsEventCallback(
+                thisPlayList.name, 'start', thisPlayList.speed, thisPlayList.from, thisPlayList.to, false, null,
+                function(state : any, objAnimation : any) {
+
+                    if (state == "播放完成") {
+
+                        playEndNum += 1;
+                        if (playEndNum >= playList.length) {
+                            callback("yes");
+                        }
+                        
+                    }
+                    
+                }
+            );
+
+        }
+
+    }
+
 }
 
 

+ 22 - 1
src/components/student/ThreeWorldEvent/event/TypeEvent.ts

@@ -122,7 +122,7 @@ export class TypeEvent {
 
             // 请将水管链接
             case '请将水管链接':
-                thisClass.work_1();
+                thisClass.work_4();
                 break;
 
             // 开始清洗
@@ -336,6 +336,27 @@ export class TypeEvent {
 
     }
 
+    /**
+     * 请将水管链接
+     */
+    work_4 = () => {
+
+        let thisClass = this;
+        let objIframeEdit = this.objIframeEdit;
+        let objIframe = this.objIframe;
+        let objScene = this.objScene;
+        let BABYLON = this.BABYLON;
+        let ChengGuangYuanJing = objIframe.ChengGuangYuanJing;
+        
+        objIframeEdit.modelPeopleLook(3);
+        objIframeEdit.roleShow(false);
+        objIframeEdit.cameraVisualAngleGetListNameGpsTo("水管视角");
+        
+        thisClass.tipsBtnsUpOpenEventCallbackMain(false);
+        thisClass.tipsBtnsDownOpenEventCallbackMain(false);
+
+    }
+