import Common5 from "../../Platform/th/Common5"; import User from "../../FrameWork/User/User"; import TaskManager from "./TaskManager"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage"; import BiJiBen from "./BiJiBen"; import ChatManager from "./ChatManager"; import EventMgr from "../../FrameWork/Event/EventMgr"; import { ryw_Event } from "../../FrameWork/Event/EventEnum"; import ChatList from "./ChatList"; const {ccclass, property} = cc._decorator; @ccclass export default class JuQingManager{ //打开对话或微信聊天 public static openJuQingOrChat(tag,parentNode?){ let indexStr = this.getCurJuQingUnLockIndex() let personConfig = this.getPersonJsonByIndexStr(indexStr) // if(personConfig && tag == personConfig.type){ if(tag == 'WX'){ PrefabManage.loadPrefabByType(GameType.ChatList,cc.director.getScene().getChildByName("Canvas").getChildByName('prefabLayer2'),(prefabNode)=>{ prefabNode.getComponent(ChatList).initView('WX') }) }else if(tag == 'DH'){ PrefabManage.loadPrefabByType(GameType.JuQingDialog,parentNode) }else if(tag == 'RJB'){ let type = 'RJB' let jsonName = 'RiJiBen' ChatManager.setSingleChatStatus(type,jsonName,indexStr,false) PrefabManage.loadPrefabByType(GameType.BiJiBen,null,(prefabNode)=>{ prefabNode.getComponent(BiJiBen).enterDialog(jsonName,indexStr,()=>{ console.log("关闭聊天的回调") }) }) }else if(tag == 'XG'){ PrefabManage.loadPrefabByType(GameType.ChatList,null,(prefabNode)=>{ prefabNode.getComponent(ChatList).initView('XG') }) } // }else{ // PrefabManage.showTextTips('打开错误') // } } //根据剧情索引str获取jsonConfig public static getJuQingJsonByIndexStr(indexStr){ for(let i=0;i