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:
@@ -201,10 +201,14 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
private summonCountCache: Map<string, number> = new Map();
|
||||
|
||||
/**
|
||||
* 解析技能 prefab 上 SkillView.summon_count 配置的单次施法召唤数量。
|
||||
* 仅使用已缓存的 prefab(oops.res.get 同步命中),未加载时回退 1(单体),不引入异步等待。
|
||||
* 解析单次施法的召唤数量。
|
||||
* 优先级:合并后配置上的 summon_count(heroSet 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}`;
|
||||
|
||||
Reference in New Issue
Block a user