import { find } from "cc"; import { ChatContentsLayout } from "./ChatContentsLayout"; import { DemoData } from "./DemoData"; import {GirlDetailPanel} from "db://assets/Scripts/test/GirlDetailPanel"; import {ChatPanel} from "db://assets/Scripts/test/ChatPanel"; import {GirlListPanel} from "db://assets/Scripts/test/girlListPanel/GirlListPanel"; import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager"; import Utils from "db://assets/Scripts/Main/Common/Utils"; import {InnerMsgCode} from "db://assets/Scripts/Main/Config/InnerMsgCode"; export class DemoManager { private static _instance: DemoManager; public static getInstance() { if (!this._instance) { this._instance = new DemoManager(); } return this._instance; } private constructor() { this.demoData = new DemoData(); } demoData: DemoData; hideMainView() { } themeId = -1; EnterGirlList(id: number = null) { if(id != null) {this.themeId = id;} if(this.themeId == -1) {return;} console.log("EnterGirlList id:"+id); ViewManager.I.openBundlesView("GirlListPanel",this.themeId); } EnterChat(id: number) { ViewManager.I.openBundlesView("ChatPanel",id); } EnterDetail(id: number) { ViewManager.I.openBundlesView("GirlDetailPanel",id); } public updateDialog(isPlayer: boolean, str: string,fromPlayer:boolean = false) { if(fromPlayer){this.demoData.cleanDialog()} this.demoData.pushDialog(isPlayer, str); console.log("update dialog"); Utils.sendInnerMsg(InnerMsgCode.Chat_DialogRefresh); } public getDialogs() { return this.demoData.GetDialogs(); } }