refactor(任务卡片): 使用close方法替代直接设置node.active

将直接设置node.active改为调用close方法,提高代码可维护性和一致性
This commit is contained in:
walkpan
2026-01-05 21:49:17 +08:00
parent 9bf8ad2625
commit 6dbf031768
2 changed files with 2 additions and 11 deletions

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "f1d3b21c-7d12-4c9b-95f9-934191e97018",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -263,7 +263,7 @@ export class MissionCardComp extends CCComp {
if (this.card4.active && !this.purchasedSlots[4]) allPurchased = false; if (this.card4.active && !this.purchasedSlots[4]) allPurchased = false;
if (allPurchased) { if (allPurchased) {
this.node.active = false; this.close();
} }
return; return;
} }
@@ -304,7 +304,7 @@ export class MissionCardComp extends CCComp {
oops.message.dispatchEvent(GameEvent.CallFriend, { uuid: selectedData.uuid }); oops.message.dispatchEvent(GameEvent.CallFriend, { uuid: selectedData.uuid });
} }
// 后续扩展其他类型事件 // 后续扩展其他类型事件
this.node.active = false; this.close();
}) })
.start(); .start();
} }