26 lines
646 B
TypeScript
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();
|
|
}
|
|
}
|