feat(skill): add summon_count config for skill summon count

1. 新增SkillConfig和SkillOverrides中的summon_count字段,用于配置单次施法召唤的技能实体个数
2. 重构SCastSystem的resolveSummonCount方法,优先使用配置中的summon_count,再回退到prefab配置
3. 调整注释说明,明确配置优先级和回退逻辑
This commit is contained in:
panFD
2026-08-20 23:18:57 +08:00
parent 18705ccee3
commit dc51cd2dae
2 changed files with 9 additions and 2 deletions

View File

@@ -201,10 +201,14 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
private summonCountCache: Map<string, number> = new Map();
/**
* 解析技能 prefab 上 SkillView.summon_count 配置的单次施法召唤数量。
* 仅使用已缓存的 prefaboops.res.get 同步命中),未加载时回退 1单体不引入异步等待
* 解析单次施法召唤数量。
* 优先级:合并后配置上的 summon_countheroSet overrides 可覆写) > prefab 上 SkillView.summon_count
* prefab 回退路径仅使用已缓存的资源oops.res.get 同步命中),未加载时回退 1单体不引入异步等待。
*/
private resolveSummonCount(config: SkillConfig): number {
if (typeof config.summon_count === "number") {
return Math.max(1, Math.floor(config.summon_count));
}
const cached = this.summonCountCache.get(config.sp_name);
if (cached !== undefined) return cached;
const path = `game/skill/atk/${config.sp_name}`;