update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user