删除LayerUI.createNode中废弃的参数

This commit is contained in:
dgflash
2022-08-25 10:08:02 +08:00
parent 06a4eb1256
commit 7daabf3d89
3 changed files with 14 additions and 8 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);