import User from "../../FrameWork/User/User"; import GameBaseScript from "../GameRoomRes/GameBaseScript"; import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager"; import UserManager from "../Manager/UserManager"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage"; import GetAward from "../SCommon/GetAward"; import DHBase from "./DHBase"; const { ccclass, property } = cc._decorator; @ccclass export default class DH_3 extends DHBase { chatConfig = [ { effectUrl: 'DH/DH_3/sound/钱总,麻烦您签下合同。', delayTime: 2.25, str: '钱总,麻烦您签下合同。', posi: '-1' }, { effectUrl: 'DH/DH_3/sound/亲爱的,他就是我前男友,你别租给他嘛', delayTime: 4.78, str: '亲爱的,他就是我前男友,你别租给他嘛', posi: 'qipao1' }, { effectUrl: 'DH/DH_3/sound/柳梦,你够快的啊,不过这事和你没关系!', delayTime: 5.22, str: '柳梦,你够快的啊,不过这事和你没关系!', posi: '-1' }, { effectUrl: 'DH/DH_3/sound/听小宝贝的,你走吧,别打扰我好事。', delayTime: 4.68, str: '听小宝贝的,你走吧,别打扰我好事。', posi: 'qipao2' }, ] @property(cc.Node) liumeng: cc.Node = null; start() { this.scheduleOnce(() => { PrefabManage.preloadPrefabByType(GameType.DH_4) }) GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig); super.start(); // let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() // let mainId = mainTaskInfo.Id // if (mainId == MainTaskIdEnum.MainTask_205) { // this.dialogIndex = 3; // this.continueStory1(); // } else { this.continueStory(); // } // this.scheduleOnce(() => { // PrefabManage.preloadPrefabByType(GameType.DH_39) // }) } // 继续剧情 continueStory() { const dialogEvents = [ (func) => { this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { }); }, (func) => { this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "入场", false) this.liumeng.getComponent(sp.Skeleton).setCompleteListener(() => { this.liumeng.getComponent(sp.Skeleton).setCompleteListener(null) this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "待机", true) this.node.getChildByName("nameplate").active = true func() }) }, (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "说话", true) }); }, (func) => { this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "待机", true) this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { }); }, (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { }); }, ] const dialogCallFunc = (logEvents: any[]) => { logEvents.shift()(() => { if (logEvents.length > 0) { dialogCallFunc(logEvents); } else { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_305) PrefabManage.showBlackGuoDu(() => { PrefabManage.loadPrefabByType(GameType.CityPrefab) TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_306) this.node.destroy() }, () => { }) } }); } dialogCallFunc(dialogEvents); } }