import { ryw_Event } from "../../../FrameWork/Event/EventEnum"; import EventMgr from "../../../FrameWork/Event/EventMgr"; import User from "../../../FrameWork/User/User"; import Common5 from "../../../Platform/th/Common5"; import JuQingManager from "../../JuQingChat/JuQingManager"; import TaskManager, { MainTaskIdEnum } from "../../JuQingChat/TaskManager"; import JuQingQiPao from "../../JuQingGuanQia/JuQingQiPao"; import BagManager from "../../Manager/BagManager"; import UserManager from "../../Manager/UserManager"; import NewGuideScript from "../../NewGuide/NewGuideScript"; import PrefabManage, { GameType } from "../../PrefabManager/PrefabManage"; import GetAward from "../../SCommon/GetAward"; import GameBaseScript from "../GameBaseScript"; let ChadianConfig = { chadianLog200: [ { str: "夏芸,你还有脸回来?", qiPaoPos: -1, delay: 2.2, effectUrl: "GameRoomRes/sound/Room2/夏芸,你还有脸回来?" }, { str: "孩子我要带走,还有这房子我还出了20万首付,这钱你得还我。", qiPaoPos: 0, delay: 2, effectUrl: "GameRoomRes/sound/Room2/孩子我要带走,还有这房子我还出了20万首付,这钱你得还我。" }, { str: "孩子你想都别想,20万我会给你的,你好自为之!", qiPaoPos: -1, delay: 3, effectUrl: "GameRoomRes/sound/Room2/孩子你想都别想,20万我会给你的,你好自为之!" }, { str: "你一个臭卖包子的,你能拿出20万?别在这吹牛了。", qiPaoPos: 1, delay: 2.7, effectUrl: "GameRoomRes/sound/Room2/你一个臭卖包子的,你能拿出20万?别在这吹牛了。" }, { str: "希望你说到做到,拿出20万给我,我们走。", qiPaoPos: 0, delay: 2, effectUrl: "GameRoomRes/sound/Room2/希望你说到做到,拿出20万给我,我们走。" }, ], chadianLog201: [ { str: "爸爸,我不要跟妈妈走。", qiPaoPos: 2, delay: 6.8, effectUrl: "GameRoomRes/sound/Room2/爸爸,我不要跟妈妈走。" }, { str: "乖,爸爸不会抛弃你的,爸爸这就去赚钱。", qiPaoPos: -1, delay: 2.9, effectUrl: "GameRoomRes/sound/Room2/乖,爸爸不会抛弃你的,爸爸这就去赚钱。" } ], chadianLog303: [ { str: "20万筹齐没?", qiPaoPos: 0, delay: 1.5, effectUrl: "GameRoomRes/sound/Room2/20万筹齐没?" }, { str: "磨磨唧唧,我还以为你给不起20万跑路了呢。", qiPaoPos: 1, delay: 2, effectUrl: "GameRoomRes/sound/Room2/磨磨唧唧,我还以为你给不起20万跑路了呢。" }, { str: "夏芸,现在这家跟你没关系了,拿着你的东西滚出去。", qiPaoPos: -1, delay: 2.9, effectUrl: "GameRoomRes/sound/Room2/夏芸,现在这家跟你没关系了,拿着你的东西滚出去。" } ], chadianLog401: [ { str: "哼,我跟你的事还没完,走着瞧。", qiPaoPos: 1, delay: 2, effectUrl: "GameRoomRes/sound/Room2/哼,我跟你的事还没完,走着瞧。" } ], chadianLog402: [ { str: "爸爸,妈妈怎么跟丑叔叔走了。", qiPaoPos: 3, delay: 2, effectUrl: "GameRoomRes/sound/Room2/爸爸,妈妈怎么跟丑叔叔走了。" }, { str: "以后爸爸一个人也会好好照顾你的。", qiPaoPos: -1, delay: 2, effectUrl: "GameRoomRes/sound/Room2/以后爸爸一个人也会好好照顾你的。" }, { str: "谁啊?来了来了", qiPaoPos: -1, delay: 2, effectUrl: "GameRoomRes/sound/Room2/谁啊?来了来了" } ], } const { ccclass, property } = cc._decorator; @ccclass export default class Room2 extends cc.Component { finishTaskStep = 0 maskGuideNode: cc.Node = null onLoad() { this.finishTaskStep = 0 } start() { GameBaseScript.preLoadRemoteAudio(ChadianConfig); EventMgr.onEvent_custom(ryw_Event.NormalTouchEndCheck, (data_) => { this.normalTouchCallback(data_.targetNode); }, this); EventMgr.onEvent_custom(ryw_Event.DirectTouchMoveCheck, (data_) => { this.normalTouchCheckCallback(data_.targetNode); }, this); this.showChatBtnStatus() EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => { this.showChatBtnStatus() }, this) EventMgr.onEvent_custom(ryw_Event.updateMainTask, () => { this.showChatBtnStatus() this.duiHuaInfo() }, this) this.duiHuaInfo() } duiHuaInfo() { let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id if (mainId == MainTaskIdEnum.MainTask_200) { this.node.getChildByName('mainNode').getChildByName('陈天霸tag').active = true this.node.getChildByName('mainNode').getChildByName('夏芸tag').active = true this.node.getChildByName('mainNode').getChildByName('林兰兰tag').active = true this.scheduleOnce(() => { this.node.getChildByName('mainNode').getChildByName('陈天霸tag').active = false this.node.getChildByName('mainNode').getChildByName('夏芸tag').active = false this.node.getChildByName('mainNode').getChildByName('林兰兰tag').active = false }, 3) // this.node.getChildByName('mainNode').getChildByName('拿酒瓶').active = true this.showQiPao(ChadianConfig.chadianLog200[0], () => { // this.node.getChildByName('mainNode').getChildByName('拿酒瓶').active = false // this.node.getChildByName('mainNode').getChildByName('女儿站').getComponent(sp.Skeleton).setAnimation(0, '摔瓶子', false) // Common5.playEffectCustom('Room2', 'sound/摔酒瓶') // this.scheduleOnce(() => { // this.node.getChildByName('mainNode').getChildByName('女儿站').getComponent(sp.Skeleton).setAnimation(0, '女儿哭泣', true) // }, 1) this.node.getChildByName('mainNode').getChildByName('老婆').getComponent(sp.Skeleton).setAnimation(0, '说话', true) this.showQiPao(ChadianConfig.chadianLog200[1], () => { this.node.getChildByName('mainNode').getChildByName('老婆').getComponent(sp.Skeleton).setAnimation(0, '待机', true) this.showQiPao(ChadianConfig.chadianLog200[2], () => { this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '说话', true) this.showQiPao(ChadianConfig.chadianLog200[3], () => { this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '待机', true) this.node.getChildByName('mainNode').getChildByName('老婆').getComponent(sp.Skeleton).setAnimation(0, '说话', true) this.showQiPao(ChadianConfig.chadianLog200[4], () => { this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '待机', true) this.node.getChildByName('mainNode').getChildByName('老婆').getComponent(sp.Skeleton).setAnimation(0, '待机', true) cc.tween(this.node.getChildByName('mainNode').getChildByName('老板')) .to(1, { opacity: 0 }) .start() cc.tween(this.node.getChildByName('mainNode').getChildByName('老婆')) .to(1, { opacity: 0 }) .start() this.scheduleOnce(() => { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_200) TaskManager.setCurTask(MainTaskIdEnum.MainTask_201) }, 1) }); }); }); }); }); } else if (mainId == MainTaskIdEnum.MainTask_201) { this.node.getChildByName('mainNode').getChildByName('女儿站').getComponent(sp.Skeleton).setAnimation(0, '女儿哭泣', true) this.showQiPao(ChadianConfig.chadianLog201[0], () => { this.showQiPao(ChadianConfig.chadianLog201[1], () => { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_201) TaskManager.setCurTask(MainTaskIdEnum.MainTask_301) User.setStatistics("zhangJie", 2) //开放出门按钮 let openBtnSpine = this.node.getChildByName('openBtnSpine') openBtnSpine.setPosition(cc.v2(0, 0)) openBtnSpine.active = true let chuMen = this.node.getChildByName('出门') chuMen.active = true chuMen.opacity = 0 openBtnSpine.getComponent(sp.Skeleton).setAnimation(0, '门1', false) this.scheduleOnce(() => { openBtnSpine.getComponent(sp.Skeleton).setAnimation(0, '门2', false) cc.tween(openBtnSpine) .to(0.5, { x: chuMen.x, y: chuMen.y }) .call(() => { cc.tween(chuMen) .set({ active: true, scale: 0.5, opacity: 255 }) .to(0.15, { scale: 0.9 }) .to(0.15, { scale: 0.8 }) .call(() => { // User.setGameGuideStepIndex(1); User.setFirstStepIndex(3); this.guideView([chuMen]); }) .start() openBtnSpine.active = false }) .start() }, 1.67) // this.showQiPao(ChadianConfig.chadianLog202[2], () => { // this.showQiPao(ChadianConfig.chadianLog202[3], () => { // this.node.getChildByName('mainNode').getChildByName('女儿站').active = false // this.node.getChildByName('mainNode').getChildByName('床边女儿').active = true // this.node.getChildByName('mainNode').getChildByName('床边女儿').getComponent(sp.Skeleton).setAnimation(0, '小女孩睡', true) // JuQingManager.unLockNewJuQing('WX_201') // TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_202) // TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_203) // }); // }); }); }); } else if (mainId == MainTaskIdEnum.MainTask_303) { this.node.getChildByName('mainNode').getChildByName('老婆').getComponent(sp.Skeleton).setAnimation(0, '说话', true) this.showQiPao(ChadianConfig.chadianLog303[0], () => { this.node.getChildByName("needGoodNode_303").active = true this.node.getChildByName('mainNode').getChildByName('老婆').getComponent(sp.Skeleton).setAnimation(0, '待机', true) }); } else if (mainId == MainTaskIdEnum.MainTask_402) { PrefabManage.preloadPrefabByType(GameType.DH_1) this.node.getChildByName('mainNode').getChildByName('女儿坐床上').getComponent(sp.Skeleton).setAnimation(0, '女孩说话', true) this.showQiPao(ChadianConfig.chadianLog402[0], () => { this.node.getChildByName('mainNode').getChildByName('女儿坐床上').getComponent(sp.Skeleton).setAnimation(0, '女孩待机', true) this.showQiPao(ChadianConfig.chadianLog402[1], () => { this.node.getChildByName('mainNode').getChildByName('敲门').active = true this.node.getChildByName('mainNode').getChildByName('敲门').getComponent(sp.Skeleton).setAnimation(0, '敲门', true) this.showQiPao(ChadianConfig.chadianLog402[2], () => { this.node.getChildByName('mainNode').getChildByName('敲门').active = false User.setStatistics("zhangJie", 4) TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_402) TaskManager.setCurTask(MainTaskIdEnum.MainTask_501) PrefabManage.loadPrefabByType(GameType.DH_1) this.scheduleOnce(() => { this.node.removeFromParent() this.node.destroy() }, 1) }) }) }) } } showChatBtnStatus() { let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id // if (mainId == MainTaskIdEnum.MainTask_200 || mainId == MainTaskIdEnum.MainTask_201) { if (mainId == MainTaskIdEnum.MainTask_200) { if (mainId == MainTaskIdEnum.MainTask_201) { this.node.getChildByName('startBtnTask201').active = true } this.node.getChildByName('mainNode').getChildByName('老板').active = true this.node.getChildByName('mainNode').getChildByName('老婆').active = true this.node.getChildByName('mainNode').getChildByName('女儿站').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_化妆品').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_衣服').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_钱').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_鞋子').active = true this.node.getChildByName('mainNode').getChildByName('衣服').active = true this.node.getChildByName('mainNode').getChildByName('抹布').active = true this.node.getChildByName('mainNode').getChildByName('现金1').active = true this.node.getChildByName('mainNode').getChildByName('菜谱').active = true // this.node.getChildByName('mainNode').getChildByName('化妆品').active = true this.node.getChildByName('mainNode').getChildByName('牌匾 破旧').active = true this.node.getChildByName('mainNode').getChildByName('老婆鞋子').active = true this.node.getChildByName('mainNode').getChildByName('行李箱').active = true let chuMen = this.node.getChildByName('出门') chuMen.active = false } if (mainId == MainTaskIdEnum.MainTask_303 || mainId == MainTaskIdEnum.MainTask_401) { this.node.getChildByName('mainNode').getChildByName('老板').active = true this.node.getChildByName('mainNode').getChildByName('老婆').active = true this.node.getChildByName('mainNode').getChildByName('女儿坐床上').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_化妆品').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_衣服').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_钱').active = true // this.node.getChildByName('mainNode').getChildByName('touchArea_鞋子').active = true this.node.getChildByName('mainNode').getChildByName('衣服').active = true this.node.getChildByName('mainNode').getChildByName('抹布').active = true this.node.getChildByName('mainNode').getChildByName('现金1').active = true this.node.getChildByName('mainNode').getChildByName('菜谱').active = true // this.node.getChildByName('mainNode').getChildByName('化妆品').active = true this.node.getChildByName('mainNode').getChildByName('牌匾 破旧').active = true this.node.getChildByName('mainNode').getChildByName('老婆鞋子').active = true this.node.getChildByName('mainNode').getChildByName('行李箱').active = true if (mainId == MainTaskIdEnum.MainTask_401) { this.node.getChildByName('startBtnTask201').active = true } } else if (mainId == MainTaskIdEnum.MainTask_201) { this.node.getChildByName('mainNode').getChildByName('女儿站').active = true this.node.getChildByName('mainNode').getChildByName('女儿站').getComponent(sp.Skeleton).setAnimation(0, '女儿哭泣', true) let chuMen = this.node.getChildByName('出门') chuMen.active = false } else if (mainId == MainTaskIdEnum.MainTask_402) { this.node.getChildByName('mainNode').getChildByName('女儿坐床上').active = true this.node.getChildByName('mainNode').getChildByName('女儿坐床上').getComponent(sp.Skeleton).setAnimation(0, '女孩待机', true) } else if (mainId == MainTaskIdEnum.MainTask_203 || mainId == MainTaskIdEnum.MainTask_204 || mainId == MainTaskIdEnum.MainTask_205 || mainId == MainTaskIdEnum.MainTask_206 || mainId == MainTaskIdEnum.MainTask_207) { if (mainId == MainTaskIdEnum.MainTask_207) { this.node.getChildByName('startBtnTask207').active = true PrefabManage.preloadPrefabByType(GameType.GameStory2) } else if (mainId == MainTaskIdEnum.MainTask_203) { cc.tween(this.node.getChildByName('mainNode').getChildByName('shouShangLian')) .set({ active: true, scale: 0, x: -138, y: -38 }) .to(0.4, { scale: 1.1, x: 0, y: 0 }) .to(0.1, { scale: 1 }) .delay(2) .to(0.4, { scale: 0, x: -138, y: -38 }) .set({ active: false }) .start() } this.node.getChildByName('mainNode').getChildByName('女儿站').active = false this.node.getChildByName('mainNode').getChildByName('床边女儿').active = true this.node.getChildByName('mainNode').getChildByName('床边女儿').getComponent(sp.Skeleton).setAnimation(0, '小女孩睡', true) } else if (mainId == MainTaskIdEnum.MainTask_208) { this.node.getChildByName('mainNode').getChildByName('床边女儿').active = true this.node.getChildByName('mainNode').getChildByName('床边女儿').getComponent(sp.Skeleton).setAnimation(0, '小女孩坐', true) this.node.getChildByName('mainNode').getChildByName('被子覆盖').active = false } else if (mainId == MainTaskIdEnum.MainTask_209) { this.node.getChildByName('mainNode').getChildByName('床边女儿').active = false this.node.getChildByName('mainNode').getChildByName('喝药spine').active = true // this.node.getChildByName('mainNode').getChildByName('床边女儿').getComponent(sp.Skeleton).setAnimation(0, '小女孩坐', true) this.node.getChildByName('mainNode').getChildByName('被子覆盖').active = false } else if (mainId == MainTaskIdEnum.MainTask_210) { let node = this.node.getChildByName('mainNode').getChildByName('touchArea_牌匾') node.active = true this.node.getChildByName('mainNode').getChildByName('被子覆盖').active = false this.guideView([node]); this.node.getChildByName('mainNode').getChildByName('床边女儿').active = true this.node.getChildByName('mainNode').getChildByName('床边女儿').getComponent(sp.Skeleton).setAnimation(0, '小女孩坐', true) this.node.getChildByName('mainNode').getChildByName('喝药spine').active = false } else if (mainId == MainTaskIdEnum.MainTask_211 || mainId == MainTaskIdEnum.MainTask_212 || mainId == MainTaskIdEnum.MainTask_213) { this.node.getChildByName('mainNode').getChildByName('touchArea_牌匾').active = false this.node.getChildByName('mainNode').getChildByName('牌匾 破旧').active = false this.node.getChildByName('mainNode').getChildByName('牌匾新').active = true this.node.getChildByName('mainNode').getChildByName('被子覆盖').active = false this.node.getChildByName('mainNode').getChildByName('床边女儿').active = true this.node.getChildByName('mainNode').getChildByName('床边女儿').getComponent(sp.Skeleton).setAnimation(0, '小女孩坐', true) } else { } } normalTouchCheckCallback(targetNode: any) { console.log("targetNodeName+++++++++++++++++++++>" + targetNode.name); switch (targetNode.name) { case 'xxxxx': break; default: break; } } normalTouchCallback(targetNode) { let xiangZi = this.node.getChildByName('mainNode').getChildByName('行李箱') switch (targetNode.name) { // case "touchArea_化妆品": // Common5.playEffectCustom('Room2', 'sound/丢东西') // this.finishTaskStep++ // cc.tween(this.node.getChildByName('mainNode').getChildByName('化妆品')) // .to(0.6, { x: xiangZi.x, y: xiangZi.y, angle: 360, scale: 0.2 }) // .call(() => { // xiangZi.getComponent(sp.Skeleton).setAnimation(0, '抖动', false) // }) // .set({ active: false }) // .start(); // break; case "touchArea_衣服": Common5.playEffectCustom('Room2', 'sound/丢东西') this.finishTaskStep++ cc.tween(this.node.getChildByName('mainNode').getChildByName('衣服')) .to(0.6, { x: xiangZi.x, y: xiangZi.y, angle: 360, scale: 0.2 }) .call(() => { xiangZi.getComponent(sp.Skeleton).setAnimation(0, '抖动', false) }) .set({ active: false }) .start(); break; case "touchArea_钱": Common5.playEffectCustom('Room2', 'sound/丢东西') this.finishTaskStep++ cc.tween(this.node.getChildByName('mainNode').getChildByName('现金')) .to(0.6, { x: xiangZi.x, y: xiangZi.y, angle: 360, scale: 0.2 }) .call(() => { xiangZi.getComponent(sp.Skeleton).setAnimation(0, '抖动', false) }) .set({ active: false }) .start(); break; case "touchArea_鞋子": Common5.playEffectCustom('Room2', 'sound/丢东西') this.finishTaskStep++ cc.tween(this.node.getChildByName('mainNode').getChildByName('老婆鞋子')) .to(0.6, { x: xiangZi.x, y: xiangZi.y, angle: 360, scale: 0.2 }) .call(() => { xiangZi.getComponent(sp.Skeleton).setAnimation(0, '抖动', false) }) .set({ active: false }) .start(); break; case "touchArea_菜谱": this.finishTaskStep++ cc.tween(this.node.getChildByName('mainNode').getChildByName('湘菜')) .set({ active: true, scale: 0 }) .to(0.2, { scale: 0.8 }) .delay(1.5) .to(0.2, { scale: 0 }) .call(() => { this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '说话', true) this.showQiPao(ChadianConfig.chadianLog201[0], () => { this.node.getChildByName('mainNode').getChildByName('老板').active = false this.node.getChildByName('mainNode').getChildByName('老婆').active = false this.node.getChildByName('mainNode').getChildByName('行李箱').active = false let bagConfig = { goodId: 3091, goodNum: 1, } BagManager.addBagList(bagConfig) TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_201) TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_202) }); }) .start() break; case "touchArea_牌匾": Common5.playEffectCustom('Room2', 'sound/擦东西') this.node.getChildByName('mainNode').getChildByName('抹布').active = false this.node.getChildByName('mainNode').getChildByName('抹布Spine').active = true this.node.getChildByName('mainNode').getChildByName('抹布Spine').getComponent(sp.Skeleton).setAnimation(0, '抹布', false) this.scheduleOnce(() => { this.node.getChildByName('mainNode').getChildByName('牌匾 破旧').active = false this.node.getChildByName('mainNode').getChildByName('牌匾新').active = true this.showQiPao(ChadianConfig.chadianLog210[0], () => { this.node.getChildByName('mainNode').getChildByName('抹布Spine').active = false let goodArray = [{ goodId: 3601, goodNum: 1 }]; PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => { prefabNode.getComponent(GetAward).initView(goodArray, () => { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_210) TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_211) EventMgr.emitEvent_custom(ryw_Event.RefreshJuQingDuiHua); }); }); }); }, 1.6) break; default: break; } if (this.finishTaskStep == 3) { // this.node.getChildByName('mainNode').getChildByName('touchArea_菜谱').active = true this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '说话', true) this.showQiPao(ChadianConfig.chadianLog401[0], () => { this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '待机', true) cc.tween(this.node.getChildByName('mainNode').getChildByName('老板')) .to(1, { opacity: 0 }) .start() cc.tween(this.node.getChildByName('mainNode').getChildByName('老婆')) .to(1, { opacity: 0 }) .start() this.scheduleOnce(() => { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_401) TaskManager.setCurTask(MainTaskIdEnum.MainTask_402) this.duiHuaInfo() }, 1) }); } } onStartTask201() { this.node.getChildByName('startBtnTask201').active = false // this.node.getChildByName('mainNode').getChildByName('touchArea_化妆品').active = true this.node.getChildByName('mainNode').getChildByName('touchArea_衣服').active = true this.node.getChildByName('mainNode').getChildByName('touchArea_钱').active = true this.node.getChildByName('mainNode').getChildByName('touchArea_鞋子').active = true } onStartTask207() { this.node.getChildByName('startBtnTask207').active = false PrefabManage.loadPrefabByType(GameType.GameStory2) } onStartTask208() { this.node.getChildByName('startBtnTask208').active = false this.node.getChildByName('膳食烟雾spine').active = true this.node.getChildByName('膳食烟雾spine').getComponent(sp.Skeleton).setAnimation(0, '打斗烟雾', true) this.scheduleOnce(() => { this.node.getChildByName('膳食烟雾spine').active = false let bagConfig = { goodId: 3005, goodNum: 1, } BagManager.addBagList(bagConfig) EventMgr.emitEvent_custom(ryw_Event.RefreshJuQingDuiHua); let node = this.node.getChildByName('needGoodNode') this.guideView([node]); }, 1.5) } chumenClickEvent() { let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id if (mainId == MainTaskIdEnum.MainTask_301) { User.setFirstStepIndex(3) } PrefabManage.loadPrefabByType(GameType.MainHall) if (cc.isValid(this.maskGuideNode)) { this.maskGuideNode.removeFromParent() this.maskGuideNode.destroy() } this.node.removeFromParent() this.node.destroy() } onClickNeedQiPao303() { if (User.getMoney() >= 200000) { UserManager.subMoney(200000) this.node.getChildByName("needGoodNode_303").active = false this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '说话', true) this.showQiPao(ChadianConfig.chadianLog303[1], () => { this.node.getChildByName('mainNode').getChildByName('老板').getComponent(sp.Skeleton).setAnimation(0, '待机', true) this.showQiPao(ChadianConfig.chadianLog303[2], () => { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_303) TaskManager.setCurTask(MainTaskIdEnum.MainTask_401) this.node.getChildByName('startBtnTask201').active = true }); }); } } guideView(nodeArray) { if (this.maskGuideNode == null) { PrefabManage.loadPrefabByType(GameType.GuideMskNode, null, (prefab) => { let guideNodeArray = nodeArray this.maskGuideNode = prefab let firstNode = guideNodeArray.shift() prefab.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray) }) } else { this.maskGuideNode.active = true let guideNodeArray = nodeArray let firstNode = guideNodeArray.shift() this.maskGuideNode.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray) } } //展示气泡 showQiPao(curLog, func?) { console.log("curLog==", curLog) if (!curLog) { console.log("xxxxxx") return; } let string_ = curLog.str let qiPaoPos_ = curLog.qiPaoPos if (qiPaoPos_ != -1) { if (curLog.effectUrl && curLog.effectUrl.length > 0) { Common5.playRemoteAudioEffect(curLog.effectUrl); } let node = this.node let qiPao = node.getChildByName("qiPao").getChildByName("qiPao_" + qiPaoPos_); let effect = node.getChildByName("声效").getChildByName("声效" + qiPaoPos_); qiPao.stopAllActions() this.showDialogStr(string_, qiPao.getChildByName("str")) // qiPao.getChildByName("str").getComponent(cc.Label).string = string_ qiPao.active = true qiPao.scale = 0 effect.active = true cc.tween(qiPao) .to(0.2, { scale: 1 }) .delay(curLog.delay) .call(() => { qiPao.active = false; effect.active = false; if (func) { func(); } }) .start(); } else { let qiPao = this.node.getChildByName("dh_qiPao") qiPao.getComponent(JuQingQiPao).initView(curLog, func) } } showDialogStr(str, dialogStr, finishFunc?) { let curStr = "" let curIndex = 0 let callFunc = () => { curStr += str[curIndex++] dialogStr.getComponent(cc.Label).string = curStr if (curIndex >= str.length) { finishFunc && finishFunc() } } this.schedule(callFunc, 0.07, str.length - 1) } }