refactor(任务卡片): 使用close方法替代直接设置node.active
将直接设置node.active改为调用close方法,提高代码可维护性和一致性
This commit is contained in:
@@ -263,7 +263,7 @@ export class MissionCardComp extends CCComp {
|
||||
if (this.card4.active && !this.purchasedSlots[4]) allPurchased = false;
|
||||
|
||||
if (allPurchased) {
|
||||
this.node.active = false;
|
||||
this.close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -304,7 +304,7 @@ export class MissionCardComp extends CCComp {
|
||||
oops.message.dispatchEvent(GameEvent.CallFriend, { uuid: selectedData.uuid });
|
||||
}
|
||||
// 后续扩展其他类型事件
|
||||
this.node.active = false;
|
||||
this.close();
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user