refactor(英雄属性): 重构英雄升级逻辑并移除无用meta文件
将英雄升级逻辑从MissionComp迁移到HeroAttrsComp中集中处理 移除两个无用的TypeScript meta文件
This commit is contained in:
@@ -55,15 +55,6 @@ export class MissionComp extends CCComp {
|
||||
onLevelUp(event: string, args: any) {
|
||||
console.log(`[MissionComp] 英雄升级到 ${args.lv} 级!`);
|
||||
|
||||
// 同步等级到 ECS 组件,防止被 updateHeroInfo 覆盖回旧值
|
||||
ecs.query(ecs.allOf(HeroAttrsComp)).forEach(e => {
|
||||
const attrs = e.get(HeroAttrsComp);
|
||||
if (attrs && attrs.is_master) {
|
||||
attrs.lv = args.lv;
|
||||
// 这里可以扩展:更新英雄属性,如 HP 上限等
|
||||
}
|
||||
});
|
||||
|
||||
// 触发奖励选择界面 (暂时留空)
|
||||
this.showLevelUpReward();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user