refactor(skill): 优化技能系统实现和配置
- 删除未使用的ECS元文件和组件 - 修复技能视图和移动逻辑,添加调试日志 - 调整技能预制体配置和动画参数 - 简化技能加载和方向处理逻辑 - 新增技能6002并更新英雄配置 - 统一受击特效路径命名
This commit is contained in:
@@ -36,7 +36,7 @@ export class Skill extends ecs.Entity {
|
||||
load(startPos: Vec3, parent: Node, s_uuid: number, targetPos: Vec3,
|
||||
caster:HeroViewComp) {
|
||||
const config = SkillSet[s_uuid];
|
||||
let casterAttrs=caster.ent.get(HeroAttrsComp).Attrs
|
||||
|
||||
if (!config) {
|
||||
console.error("[Skill] 技能配置不存在:", s_uuid);
|
||||
return;
|
||||
@@ -51,20 +51,15 @@ export class Skill extends ecs.Entity {
|
||||
}
|
||||
// console.log("load skill startPos",startPos)
|
||||
const node: Node = instantiate(prefab);
|
||||
console.log("load skill node",node)
|
||||
// console.log("load skill node",node)
|
||||
node.parent = parent;
|
||||
// 设置节点属性
|
||||
node.setPosition(startPos);
|
||||
|
||||
if(casterAttrs.fac==FacSet.MON){
|
||||
node.scale=v3(node.scale.x*-1,1,1)
|
||||
}else{
|
||||
if(casterAttrs.type==HType.warrior){
|
||||
if(casterAttrs.node.scale<0){
|
||||
node.scale=v3(node.scale.x*-1,node.scale.y,1)
|
||||
}
|
||||
}
|
||||
|
||||
if(caster.node.scale.x < 0){
|
||||
node.setScale(v3(node.scale.x*-1,node.scale.y,1))
|
||||
}
|
||||
|
||||
// 初始视图
|
||||
const SView = node.getComponent(SkillView);
|
||||
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
|
||||
@@ -78,14 +73,15 @@ export class Skill extends ecs.Entity {
|
||||
sMoveCom.startPos=startPos
|
||||
sMoveCom.targetPos=targetPos
|
||||
sMoveCom.s_uuid=s_uuid
|
||||
|
||||
sMoveCom.scale=caster.node.scale.x < 0 ? -1 : 1
|
||||
|
||||
let casterAttrs=caster.ent.get(HeroAttrsComp).Attrs
|
||||
// 初始化数据组件
|
||||
const sDataCom = this.get(SDataCom);
|
||||
sDataCom.group=caster.box_group
|
||||
sDataCom.caster=caster
|
||||
sDataCom.Attrs=casterAttrs
|
||||
sDataCom.s_uuid=s_uuid
|
||||
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
|
||||
Reference in New Issue
Block a user