fix: 调整友方技能特效位置和动画轨迹
- 修正buff.prefab的缩放和透明度,提升视觉效果 - 调整sbox.prefab中多个UI元素的位置和对齐方式 - 简化友方技能特效动画为直线运动,移除贝塞尔曲线计算 - 为技能特效添加高度偏移,避免与角色模型重叠
This commit is contained in:
@@ -99,8 +99,8 @@
|
|||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0.5,
|
"x": 0.7,
|
||||||
"y": 0.5,
|
"y": 0.7,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_mobility": 0,
|
"_mobility": 0,
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
"r": 255,
|
"r": 255,
|
||||||
"g": 255,
|
"g": 255,
|
||||||
"b": 255,
|
"b": 255,
|
||||||
"a": 206
|
"a": 255
|
||||||
},
|
},
|
||||||
"_spriteFrame": {
|
"_spriteFrame": {
|
||||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@ce362",
|
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@ce362",
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 40,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -287,7 +287,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 40,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -623,7 +623,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 40,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -798,7 +798,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 40,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -973,7 +973,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 40,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -1145,7 +1145,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -35.658,
|
"y": 6.375,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -1300,7 +1300,7 @@
|
|||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0.5,
|
"x": 0.5,
|
||||||
"y": 0.5
|
"y": 0
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
|||||||
* 2. 处理 buffs 配置追加
|
* 2. 处理 buffs 配置追加
|
||||||
* 3. 保留完整施法信息参数,便于后续扩展更多友方效果
|
* 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 kind = config.kind ?? SkillKind.Support;
|
||||||
const sUp = SkillUpList[_s_uuid] ?? SkillUpList[1001];
|
const sUp = SkillUpList[_s_uuid] ?? SkillUpList[1001];
|
||||||
const sAp =config.ap+sUp.ap*_skillLv;
|
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) {
|
for (const target of applyTargets) {
|
||||||
const startPos = _heroView?.node?.position || _targetPos;
|
const startPos = _heroView?.node?.position || _targetPos;
|
||||||
if (startPos) {
|
if (startPos) {
|
||||||
this.playFriendlyCastEffect(startPos, target, () => {
|
this.playFriendlyCastEffect(startPos, target, isCardSkill, () => {
|
||||||
this.applyActualFriendlyEffect(target, kind, sAp, _cAttrsComp, config, sUp);
|
this.applyActualFriendlyEffect(target, kind, sAp, _cAttrsComp, config, sUp);
|
||||||
});
|
});
|
||||||
} else {
|
} 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) {
|
if (!target.node || !target.node.isValid) {
|
||||||
callback();
|
callback();
|
||||||
return;
|
return;
|
||||||
@@ -411,14 +411,14 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
|||||||
callback();
|
callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.doPlayFriendlyCastEffect(startPos.clone(), target, res as Prefab, callback);
|
this.doPlayFriendlyCastEffect(startPos.clone(), target, res as Prefab, isCardSkill, callback);
|
||||||
});
|
});
|
||||||
} else {
|
} 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) {
|
if (!target.node || !target.node.isValid) {
|
||||||
callback();
|
callback();
|
||||||
return;
|
return;
|
||||||
@@ -432,31 +432,19 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
|||||||
|
|
||||||
const node = instantiate(prefab);
|
const node = instantiate(prefab);
|
||||||
node.parent = parent;
|
node.parent = parent;
|
||||||
|
|
||||||
|
startPos.y += 15;
|
||||||
node.setPosition(startPos);
|
node.setPosition(startPos);
|
||||||
|
|
||||||
const targetPos = target.node.position.clone();
|
const targetPos = target.node.position.clone();
|
||||||
targetPos.y += 50;
|
targetPos.y += 15;
|
||||||
|
|
||||||
const midX = (startPos.x + targetPos.x) / 2;
|
|
||||||
const midY = Math.max(startPos.y, targetPos.y) + 200;
|
|
||||||
|
|
||||||
const dist = Vec3.distance(startPos, targetPos);
|
const dist = Vec3.distance(startPos, targetPos);
|
||||||
const duration = Math.min(0.6, Math.max(0.3, dist / 800));
|
const duration = Math.min(0.6, Math.max(0.3, dist / 800));
|
||||||
|
|
||||||
const proxy = { ratio: 0 };
|
// 统一走直线
|
||||||
tween(proxy)
|
tween(node)
|
||||||
.to(duration, { ratio: 1 }, {
|
.to(duration, { position: targetPos, angle: -720 }, { easing: 'sineOut' })
|
||||||
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;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.call(() => {
|
.call(() => {
|
||||||
if (node.isValid) node.destroy();
|
if (node.isValid) node.destroy();
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
Reference in New Issue
Block a user