feat(技能系统): 实现技能移动系统并优化位置计算
- 新增SMoveSystem处理技能移动逻辑,支持多种移动类型 - 使用Vec3.lerp优化直线运动的位置计算 - 调整技能起始位置y轴偏移量 - 为线性移动类型添加方向旋转功能
This commit is contained in:
@@ -253,6 +253,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
|
||||
|
||||
// 获取施法者位置作为起始位置
|
||||
const startPos = caster.node.position.clone();
|
||||
startPos.y += 50;
|
||||
|
||||
const targetPos = targets[0]; // 使用第一个目标位置
|
||||
// console.log(`[SACastSystem]: ${s_uuid}, 起始位置: ${startPos}, 目标位置: ${targetPos}`);
|
||||
@@ -327,11 +328,12 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
|
||||
if (!model || !view || !view.node) return false;
|
||||
if (model.is_dead) return false;
|
||||
if (model.fac === fac) return false;
|
||||
const pos = view.node.position;
|
||||
const pos = view.node.position.clone();
|
||||
pos.y += 50;
|
||||
const dist = Math.abs(currentPos.x - pos.x);
|
||||
if (dist <= range) {
|
||||
const laneBias = Math.abs(currentPos.y - pos.y);
|
||||
results.push({ pos: pos.clone(), dist, laneBias });
|
||||
results.push({ pos: pos, dist, laneBias });
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user