refactor(技能系统): 重构技能系统以使用s_uuid作为主键并优化技能施放逻辑
- 将HeroSkillsComp中的技能数组改为以s_uuid为键的对象存储 - 修改CSRequestComp使用s_uuid替代skillIndex - 优化SkillCastSystem和SACastSystem的施放逻辑 - 为SMoveDataComp添加rePos方法处理技能位置计算 - 移除未使用的SDataComSystem代码
This commit is contained in:
@@ -2,6 +2,7 @@ import { Vec3, v3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { BezierMove } from "../BezierMove/BezierMove";
|
||||
import { RType, SkillSet } from "../common/config/SkillSet";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
/**
|
||||
* 技能移动数据组件
|
||||
* 存储技能实体的移动相关数据
|
||||
@@ -29,6 +30,21 @@ export class SMoveDataComp extends ecs.Comp {
|
||||
this.direction.set(0, 0, 0);
|
||||
this.autoDestroy = true;
|
||||
}
|
||||
rePos(originalStart:Vec3){
|
||||
if(!originalStart){
|
||||
return
|
||||
}
|
||||
// 计算延长后的目标点坐标
|
||||
const originalTarget = v3(this.targetPos.x, this.targetPos.y + BoxSet.ATK_Y);
|
||||
const direction = new Vec3();
|
||||
Vec3.subtract(direction, originalTarget, originalStart);
|
||||
const distance = direction.length();
|
||||
direction.normalize();
|
||||
const extendedTarget = new Vec3();
|
||||
Vec3.scaleAndAdd(extendedTarget, originalTarget, direction, 720);
|
||||
this.startPos.set(originalStart);
|
||||
this.targetPos.set(extendedTarget);
|
||||
}
|
||||
}
|
||||
|
||||
// /** 业务层业务逻辑处理对象 */
|
||||
|
||||
Reference in New Issue
Block a user