feat(map): 新增英雄出售事件并更新场上英雄数量UI
- 新增GameEvent.HeroSell事件枚举,在英雄出售时派发通知 - 在HInfoComp中添加事件派发代码,在MissionCardComp中注册监听更新UI - 调整英雄统计逻辑与事件派发逻辑,简化最大英雄数量获取函数 - 为多款英雄预制体添加影子显示组件
This commit is contained in:
@@ -309,6 +309,9 @@ export class HInfoComp extends CCComp {
|
||||
// 使用统一经济管理入口出售英雄(按等级计算卖价)
|
||||
MissionEconomy.executeSellHero(heroLv);
|
||||
|
||||
// 派发英雄出售事件,通知 MissionCardComp 更新场上英雄数量
|
||||
oops.message.dispatchEvent(GameEvent.HeroSell, { eid: this.eid });
|
||||
|
||||
this.isClosing = true;
|
||||
oops.gui.remove(UIID.HInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user