feat: 添加卡牌使用组件并集成至卡牌系统

- 新增 CardUseComp 组件,用于处理卡牌使用逻辑和效果分发
- 在 CardComp 中集成 CardUseComp,卡牌使用时触发效果事件
- 修改 MissionCardComp,任务开始时自动发牌至槽位
- 更新预制体资源,修复卡牌 UI 节点引用
This commit is contained in:
walkpan
2026-03-14 13:07:26 +08:00
parent 4530f9e219
commit 2f1af99a1b
6 changed files with 408 additions and 291 deletions

View File

@@ -55,7 +55,7 @@ export class MissionCardComp extends CCComp {
this.onMissionStart();
}
/** 任务开始时重置卡池等级、清空4槽、显示面板 */
/** 任务开始时重置卡池等级、清空4槽、显示面板 刷新一次卡池*/
onMissionStart() {
this.poolLv = CARD_POOL_INIT_LEVEL;
this.layoutCardSlots();
@@ -65,6 +65,8 @@ export class MissionCardComp extends CCComp {
}
this.updatePoolLvUI();
this.node.active = true;
const cards = this.buildDrawCards();
this.dispatchCardsToSlots(cards);
mLogger.log(this.debugMode, "MissionCardComp", "mission start", {
poolLv: this.poolLv
});