This commit is contained in:
2025-07-22 16:43:10 +08:00
parent a90dce06f3
commit 52bae0735f
36 changed files with 10224 additions and 1658 deletions
+10 -4
View File
@@ -4,11 +4,10 @@ import { DialogBubble } from "./DialogBubble";
import { Dialog } from "./DemoData";
const { ccclass, property } = _decorator;
const BUTTOM_Y = -346.354;
const BUTTOM_Y = -955.571;
@ccclass("ChatContentsLayout")
export class ChatContentsLayout extends Component {
@property(DemoManager)
manager: DemoManager = null;
@property(DialogBubble)
@@ -21,6 +20,11 @@ export class ChatContentsLayout extends Component {
protected start(): void {
this.lBubble.node.active = false;
this.rBubble.node.active = false;
}
protected onEnable(): void {
if (!this.manager) this.manager = DemoManager.getInstance();
this.manager.layoutout = this;
}
@@ -43,11 +47,13 @@ export class ChatContentsLayout extends Component {
newBubbleNode.setParent(this.node);
newBubble.node.active = true;
let offset = newBubble.updateBubbleContent(dialog.content);
let pos = newBubble.node.position;
newBubble.node.position = new Vec3(pos.x, initPosY, pos.z);
let offset = newBubble.updateBubbleContent(dialog.content);
initPosY += offset + 40;
initPosY += offset + 20;
this.bubbles.push(newBubble);
}
}