refactor: 移除全局主角引用,改用ECS查询定位主角实体

- 移除 SingletonModuleComp 中的 role 字段及相关设置
- 在 MissionComp 中移除重置 role 的代码
- 修改 Hero 类的销毁方法,不再清理 role 引用
- 在 MissionCardComp 中通过 HeroMasterComp 查询来定位主角实体
- 增加详细调试日志以追踪天赋、技能等组件的添加过程
This commit is contained in:
panw
2026-02-03 15:56:22 +08:00
parent 63dd22fb88
commit 147131d3c2
4 changed files with 25 additions and 38 deletions

View File

@@ -277,8 +277,8 @@ do_ad(){
this.spawnedSpecialIndices.clear(); // 重置特殊刷怪记录
// 重置全局属性加成和主角引用 (确保新一局数据干净)
console.log(`[MissionComp] data_init 重置 smc.role 为 null`);
smc.role = null;
// console.log(`[MissionComp] data_init 重置 smc.role 为 null`);
// smc.role = null;
// 重置英雄数据,确保新一局是初始状态
smc.vmdata.hero = {