From 488a6054abd57eb933564d4db9d057283e3ae513 Mon Sep 17 00:00:00 2001 From: Vick Scarlet Date: Wed, 1 Dec 2021 18:30:36 +0800 Subject: [PATCH] fix uiManager bug --- src/ui/uiManager.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui/uiManager.js b/src/ui/uiManager.js index f9a8392..37b9332 100644 --- a/src/ui/uiManager.js +++ b/src/ui/uiManager.js @@ -153,14 +153,14 @@ export default class UIManager { async showDialog(dialogName, args, actions) { const className = this.#pages[dialogName]; - const dialog = await this.getView(className, args, actions?.load, viewName, 'pages'); - - dialog.init(args); + const dialog = await this.getView(className, args, actions?.load, dialogName, 'pages'); + dialog.centerX = dialog.centerY = 0; + dialog.init?.(args); this.#dialogLayer.addChild(dialog); const open = actions?.open || (async () => { - this.#dialogLayer.scaleX = 0; - this.#dialogLayer.scaleY = 0; + dialog.scaleX = 0; + dialog.scaleY = 0; await Laya.promises.Tween.to(dialog, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.backOut); }); await open(dialog);