diff --git a/assets/core/gui/layer/LayerDialog.ts b/assets/core/gui/layer/LayerDialog.ts index 8b92e86..1b9a3fe 100644 --- a/assets/core/gui/layer/LayerDialog.ts +++ b/assets/core/gui/layer/LayerDialog.ts @@ -2,7 +2,7 @@ * @Author: dgflash * @Date: 2021-07-03 16:13:17 * @LastEditors: dgflash - * @LastEditTime: 2022-06-16 10:03:47 + * @LastEditTime: 2022-08-25 10:04:32 */ import { Node } from "cc"; @@ -63,7 +63,7 @@ export class LayerDialog extends LayerPopUp { if (this.queue.length > 0) { this.current = this.queue.shift()!; if (this.current.node) { - this.createNode(null, this.current); + this.createNode(this.current); } else { this.load(this.current); diff --git a/assets/core/gui/layer/LayerNotify.ts b/assets/core/gui/layer/LayerNotify.ts index b02c922..f9c5496 100644 --- a/assets/core/gui/layer/LayerNotify.ts +++ b/assets/core/gui/layer/LayerNotify.ts @@ -1,3 +1,9 @@ +/* + * @Author: dgflash + * @Date: 2022-08-15 10:06:47 + * @LastEditors: dgflash + * @LastEditTime: 2022-08-25 10:04:19 + */ import { error, instantiate, Node, Prefab } from "cc"; import { resLoader } from "../../common/loader/ResLoader"; import { ViewParams } from "./Defines"; @@ -42,12 +48,12 @@ export class LayerNotify extends LayerUI { let comp: DelegateComponent = childNode.addComponent(DelegateComponent); comp.viewParams = viewParams; - this.createNode(res, viewParams); + this.createNode(viewParams); }); } - protected createNode(prefab: Prefab, viewParams: ViewParams) { - let childNode: Node = super.createNode(prefab, viewParams); + protected createNode(viewParams: ViewParams) { + let childNode: Node = super.createNode(viewParams); let toastCom = childNode.getComponent(Notify)!; childNode.active = true; toastCom.toast(viewParams.params.content, viewParams.params.useI18n); diff --git a/assets/core/gui/layer/LayerUI.ts b/assets/core/gui/layer/LayerUI.ts index 99325ef..bf0be2b 100644 --- a/assets/core/gui/layer/LayerUI.ts +++ b/assets/core/gui/layer/LayerUI.ts @@ -83,7 +83,7 @@ export class LayerUI extends Node { protected load(viewParams: ViewParams, bundle?: string) { var vp: ViewParams = this.ui_nodes.get(viewParams.uuid)!; if (vp && vp.node) { - this.createNode(null, vp); + this.createNode(vp); } else { // 获取预制件资源 @@ -99,7 +99,7 @@ export class LayerUI extends Node { let comp: DelegateComponent = childNode.addComponent(DelegateComponent); comp.viewParams = viewParams; - this.createNode(res, viewParams); + this.createNode(viewParams); }); } } @@ -109,7 +109,7 @@ export class LayerUI extends Node { * @param prefab * @param viewParams */ - protected createNode(prefab: Prefab | null, viewParams: ViewParams) { + protected createNode(viewParams: ViewParams) { viewParams.valid = true; let childNode: Node | null = viewParams!.node!; let comp: DelegateComponent | null = childNode.getComponent(DelegateComponent);