refactor(skill): 重构技能移动系统,整合移动逻辑到SMoveComp

将技能移动逻辑从SkillView迁移到SMoveComp,实现统一的移动管理
添加多种移动类型支持(线性、贝塞尔、固定位置)
优化移动参数配置,从SkillView获取攻击偏移量
This commit is contained in:
2025-11-01 12:16:21 +08:00
parent ab03e32278
commit d014e63d27
5 changed files with 465 additions and 118 deletions

View File

@@ -56,19 +56,24 @@ export class Skill extends ecs.Entity {
// 初始视图
const SView = node.getComponent(SkillView);
console.log("load skill SView",SView)
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
// 核心标识
SView.s_uuid= s_uuid
SView.group= caster.box_group
this.add(SView);
// 初始化移动组件
// 初始化移动组件 - 从SkillView获取移动参数
const sMoveCom = this.get(SMoveDataComp);
sMoveCom.startPos=startPos
sMoveCom.targetPos=targetPos
sMoveCom.s_uuid=s_uuid
sMoveCom.scale=caster.node.scale.x < 0 ? -1 : 1
sMoveCom.startPos.set(startPos);
sMoveCom.targetPos.set(targetPos);
sMoveCom.s_uuid = s_uuid;
sMoveCom.scale = caster.node.scale.x < 0 ? -1 : 1;
sMoveCom.runType = config.RType;
sMoveCom.endType = config.EType;
// 从SkillView获取移动参数位置初始化由SMoveSystem统一处理
sMoveCom.atk_x = SView.atk_x;
sMoveCom.atk_y = SView.atk_y;
let cAttrsComp=caster.ent.get(HeroAttrsComp)
// 初始化数据组件