判空问题

This commit is contained in:
2025-05-28 17:00:47 +08:00
parent 6e850ff6a9
commit 367d40d4b0
2 changed files with 2 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ export class UIManager extends Laya.Script {
private UIRoot: Laya.Panel private UIRoot: Laya.Panel
public getUIRoot(): Laya.Node { public getUIRoot(): Laya.Node {
if (this.UIRoot == null) { if (!this.UIRoot) {
this.UIRoot = this.owner.getChildByName("UIRoot") as Laya.Panel this.UIRoot = this.owner.getChildByName("UIRoot") as Laya.Panel
if (config.H_SCREEN) { if (config.H_SCREEN) {
this.UIRoot.width = config.DESIGN_HEIGHT this.UIRoot.width = config.DESIGN_HEIGHT

View File

@@ -231,7 +231,7 @@ export class DailyChallenge extends Laya.Script {
unit.label_show.visible = false unit.label_show.visible = false
} }
} }
if (this.selectedUnit == null) if (!this.selectedUnit)
this.selectedUnit = this.units[info.begin+info.dayCount-1] this.selectedUnit = this.units[info.begin+info.dayCount-1]
this.onApplyUnit(this.selectedUnit) this.onApplyUnit(this.selectedUnit)
} }