fix: 调整友方技能特效位置和动画轨迹
- 修正buff.prefab的缩放和透明度,提升视觉效果 - 调整sbox.prefab中多个UI元素的位置和对齐方式 - 简化友方技能特效动画为直线运动,移除贝塞尔曲线计算 - 为技能特效添加高度偏移,避免与角色模型重叠
This commit is contained in:
@@ -376,7 +376,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
* 2. 处理 buffs 配置追加
|
||||
* 3. 保留完整施法信息参数,便于后续扩展更多友方效果
|
||||
*/
|
||||
private applyFriendlySkillEffects(_s_uuid: number, _skillLv: number, config: SkillConfig, _heroView: HeroViewComp, _cAttrsComp: HeroAttrsComp, targets: HeroViewComp[], _targetPos: Vec3 | null) {
|
||||
private applyFriendlySkillEffects(_s_uuid: number, _skillLv: number, config: SkillConfig, _heroView: HeroViewComp, _cAttrsComp: HeroAttrsComp, targets: HeroViewComp[], _targetPos: Vec3 | null, isCardSkill: boolean = false) {
|
||||
const kind = config.kind ?? SkillKind.Support;
|
||||
const sUp = SkillUpList[_s_uuid] ?? SkillUpList[1001];
|
||||
const sAp =config.ap+sUp.ap*_skillLv;
|
||||
@@ -388,7 +388,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
for (const target of applyTargets) {
|
||||
const startPos = _heroView?.node?.position || _targetPos;
|
||||
if (startPos) {
|
||||
this.playFriendlyCastEffect(startPos, target, () => {
|
||||
this.playFriendlyCastEffect(startPos, target, isCardSkill, () => {
|
||||
this.applyActualFriendlyEffect(target, kind, sAp, _cAttrsComp, config, sUp);
|
||||
});
|
||||
} else {
|
||||
@@ -397,7 +397,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
}
|
||||
}
|
||||
|
||||
private playFriendlyCastEffect(startPos: Vec3, target: HeroViewComp, callback: Function) {
|
||||
private playFriendlyCastEffect(startPos: Vec3, target: HeroViewComp, isCardSkill: boolean, callback: Function) {
|
||||
if (!target.node || !target.node.isValid) {
|
||||
callback();
|
||||
return;
|
||||
@@ -411,14 +411,14 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
this.doPlayFriendlyCastEffect(startPos.clone(), target, res as Prefab, callback);
|
||||
this.doPlayFriendlyCastEffect(startPos.clone(), target, res as Prefab, isCardSkill, callback);
|
||||
});
|
||||
} else {
|
||||
this.doPlayFriendlyCastEffect(startPos.clone(), target, prefab as Prefab, callback);
|
||||
this.doPlayFriendlyCastEffect(startPos.clone(), target, prefab as Prefab, isCardSkill, callback);
|
||||
}
|
||||
}
|
||||
|
||||
private doPlayFriendlyCastEffect(startPos: Vec3, target: HeroViewComp, prefab: Prefab, callback: Function) {
|
||||
private doPlayFriendlyCastEffect(startPos: Vec3, target: HeroViewComp, prefab: Prefab, isCardSkill: boolean, callback: Function) {
|
||||
if (!target.node || !target.node.isValid) {
|
||||
callback();
|
||||
return;
|
||||
@@ -432,31 +432,19 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
|
||||
const node = instantiate(prefab);
|
||||
node.parent = parent;
|
||||
|
||||
startPos.y += 15;
|
||||
node.setPosition(startPos);
|
||||
|
||||
const targetPos = target.node.position.clone();
|
||||
targetPos.y += 50;
|
||||
|
||||
const midX = (startPos.x + targetPos.x) / 2;
|
||||
const midY = Math.max(startPos.y, targetPos.y) + 200;
|
||||
targetPos.y += 15;
|
||||
|
||||
const dist = Vec3.distance(startPos, targetPos);
|
||||
const duration = Math.min(0.6, Math.max(0.3, dist / 800));
|
||||
|
||||
const proxy = { ratio: 0 };
|
||||
tween(proxy)
|
||||
.to(duration, { ratio: 1 }, {
|
||||
easing: 'sineOut',
|
||||
onUpdate: () => {
|
||||
if (!node.isValid) return;
|
||||
const r = proxy.ratio;
|
||||
const x = (1 - r) * (1 - r) * startPos.x + 2 * r * (1 - r) * midX + r * r * targetPos.x;
|
||||
const y = (1 - r) * (1 - r) * startPos.y + 2 * r * (1 - r) * midY + r * r * targetPos.y;
|
||||
node.setPosition(new Vec3(x, y, startPos.z));
|
||||
node.setScale(new Vec3(1 - r * 0.3, 1 - r * 0.3, 1));
|
||||
node.angle = -r * 720;
|
||||
}
|
||||
})
|
||||
// 统一走直线
|
||||
tween(node)
|
||||
.to(duration, { position: targetPos, angle: -720 }, { easing: 'sineOut' })
|
||||
.call(() => {
|
||||
if (node.isValid) node.destroy();
|
||||
callback();
|
||||
|
||||
Reference in New Issue
Block a user