import User from "../../FrameWork/User/User"; import Common5 from "../../Platform/th/Common5"; import GameBaseScript from "../GameRoomRes/GameBaseScript"; import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager"; import UserManager from "../Manager/UserManager"; import NewGuideScript from "../NewGuide/NewGuideScript"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage"; import GetAward from "../SCommon/GetAward"; import DHBase from "./DHBase"; const { ccclass, property, disallowMultiple, menu } = cc._decorator; @ccclass @disallowMultiple() @menu('对话剧情/DH_22') export default class DH_22 extends DHBase { chatConfig = [ { effectUrl: 'DH/DH_22/sound/陈先生,能有幸请您吃个便饭,聊聊吗?', delayTime: 3.12, str: '陈先生,能有幸请您吃个便饭,聊聊吗?', posi: 'qipao1' }, { effectUrl: 'DH/DH_22/sound/(果然跟前世一样,招揽不成,又来美人计。)', delayTime: 4.04, str: '(果然跟前世一样,招揽不成,又来美人计。)', posi: '-1' }, { effectUrl: 'DH/DH_22/sound/行,那边有家不错的餐厅,我们去那边吧。', delayTime: 3.12, str: '行,那边有家不错的餐厅,我们去那边吧。', posi: '-1' }, ] @property(sp.Skeleton) nanzhu: sp.Skeleton = null @property(sp.Skeleton) liuruyan: sp.Skeleton = null @property(cc.Node) m_bg: cc.Node = null @property(cc.Node) MoveNodes: cc.Node = null start() { Common5.playRemoteAudioMusic("remotesound/effect/轻快-10秒", true) Common5.preLoadRemoteAudioByChatConfig(this.chatConfig); super.start(); this.continueStory(); // this.scheduleOnce(() => { // PrefabManage.preloadPrefabByType(GameType.DH_229) // }) } // 继续剧情 continueStory() { this.scheduleOnce(() => { PrefabManage.preloadPrefabByType(GameType.DH_23) }) this.nanzhu.setAnimation(0, "男主待机", true) this.liuruyan.setAnimation(0, "柳如燕待机", true) const dialogEvents = [ (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { this.liuruyan.setAnimation(0, "柳如燕说话", true) }); }, (func) => { this.liuruyan.setAnimation(0, "柳如燕待机", true) this.nanzhu.setAnimation(0, "男主待机", true) this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { // this.nanzhu.setAnimation(0, "男主说话", true) }); }, (func) => { this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { this.nanzhu.setAnimation(0, "男主说话", true) }); }, ] const dialogCallFunc = (logEvents: any[]) => { logEvents.shift()(() => { if (logEvents.length > 0) { dialogCallFunc(logEvents); } else { this.nanzhu.setAnimation(0, "男主待机", true) PrefabManage.showBlackGuoDu(() => { PrefabManage.loadPrefabByType(GameType.DH_23) this.node.removeFromParent() this.node.destroy() }) } }); } dialogCallFunc(dialogEvents); } guideView(nodeArray, opacity = -1) { PrefabManage.loadPrefabByType(GameType.GuideMskNode, this.node, (prefab) => { // prefab.zIndex = 199 let guideNodeArray = nodeArray let firstNode = guideNodeArray.shift() prefab.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray) if (opacity != -1) { prefab.getComponent(NewGuideScript).setOpacityMaskNode(opacity) } }) } runBg(time, scale, endnode, callFunc) { cc.tween(this.m_bg) .to(time, { scale: scale }) .start() cc.tween(this.m_bg) .sequence( cc.tween().to(time, { position: cc.v2(-endnode.position.x * scale, -endnode.position.y * scale) }), cc.tween().call(() => { callFunc() }) ) .start() } }