Files
18xchat/assets/Scripts/test/DemoManager.ts
T
2025-07-21 22:14:06 +08:00

26 lines
646 B
TypeScript

import { _decorator, Component, Node } from "cc";
import { DemoData, Dialog } from "./DemoData";
import { ChatContentsLayout } from "./ChatContentsLayout";
const { ccclass, property } = _decorator;
@ccclass("DemoManager")
export class DemoManager extends Component {
demoData: DemoData;
public layoutout: ChatContentsLayout;
start() {
this.demoData = new DemoData();
}
public updateDialog(isPlayer: boolean, str: string) {
this.demoData.pushDialog(isPlayer, str);
console.log("update dialog");
this.layoutout.UpdateDialog(this.getDialogs());
}
public getDialogs() {
return this.demoData.GetDialogs();
}
}