refactor(英雄管理): 将英雄与金币数据迁移至全局任务数据

- 移除 Hero.ts 中手动维护的 hero_num 计数逻辑
- 在 SingletonModuleComp 的 mission_data 中添加 hero_max_num、hero_extend_max_num 字段
- 重构 MissionCardComp,使其通过 smc.vmdata.mission_data 读写英雄数量、金币等状态
- 新增辅助方法统一数据访问与同步,避免状态分散管理
This commit is contained in:
walkpan
2026-03-25 23:32:55 +08:00
parent 8a151a3922
commit afe11291f1
4 changed files with 958 additions and 870 deletions

View File

@@ -62,6 +62,8 @@ export class SingletonModuleComp extends ecs.Comp {
mission_data:{
mon_num:0,//怪物数量
hero_num:0,//英雄数量
hero_max_num:5,//英雄可召唤上限
hero_extend_max_num:6,//英雄可拓展上限
wave_time_num:0,//波次时间
in_fight:false,
fight_time:0,//战斗时间
@@ -236,4 +238,4 @@ export class SingletonModuleComp extends ecs.Comp {
}
export var smc: SingletonModuleComp = ecs.getSingleton(SingletonModuleComp);
export var smc: SingletonModuleComp = ecs.getSingleton(SingletonModuleComp);