refactor(任务卡片): 使用close方法替代直接设置node.active
将直接设置node.active改为调用close方法,提高代码可维护性和一致性
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"ver": "4.0.24",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "f1d3b21c-7d12-4c9b-95f9-934191e97018",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user