fix: 修复怪物技能、朝向和飘字显示问题

1. 修正技能节点缩放逻辑,确保镜像显示正确
2. 修复怪物反向移动时的朝向错误
3. 调整伤害飘字的Y轴偏移,优化显示位置
4. 更新怪物配置的技能ID,修正技能绑定错误
This commit is contained in:
walkpan
2026-05-21 20:13:28 +08:00
parent 7c54f58be1
commit f7db4da113
4 changed files with 28 additions and 19 deletions

View File

@@ -71,8 +71,8 @@ export class TooltipCom extends CCComp {
// 设置极高的渲染层级,防止被怪物遮挡
const topSiblingIndex = 9999;
// 临时变量存储当前Y坐标方便统一处理
let currentY = this.node.position.y;
// 临时变量存储当前Y坐标方便统一处理。增加60的Y轴基础偏移防止伤害飘字等遮挡血条
let currentY = this.node.position.y + 30;
switch (this.stype) {
case TooltipTypes.life: // 普通伤害
@@ -82,11 +82,13 @@ export class TooltipCom extends CCComp {
scaleMax = 1.5;
break;
case TooltipTypes.health: // 治疗
this.node.setPosition(v3(this.node.position.x + offsetX, currentY));
this.node.setSiblingIndex(topSiblingIndex);
this.setupLabel("add_life", "hp", this.value);
isHeal = true;
break;
case TooltipTypes.addmp: // 回蓝
this.node.setPosition(v3(this.node.position.x + offsetX, currentY));
this.node.setSiblingIndex(topSiblingIndex);
this.setupLabel("add_mp", "mp", this.value);
isHeal = true;
@@ -107,25 +109,26 @@ export class TooltipCom extends CCComp {
break;
case TooltipTypes.uskill:
this.setupLabel("uskill", "name", this.value);
this.node.setPosition(v3(this.node.position.x, this.node.position.y + 30));
this.node.setPosition(v3(this.node.position.x, currentY + 30));
this.node.setSiblingIndex(topSiblingIndex);
break;
case TooltipTypes.lvup:
this.node.getChildByName("lvup").active = true;
this.node.setPosition(v3(this.node.position.x, this.node.position.y - 30));
this.node.setPosition(v3(this.node.position.x, currentY - 30));
this.node.setSiblingIndex(topSiblingIndex);
break;
case TooltipTypes.apup:
this.setupLabel("apup", "num", "+" + this.value);
this.node.setPosition(v3(this.node.position.x, this.node.position.y - 60));
this.node.setPosition(v3(this.node.position.x, currentY - 60));
this.node.setSiblingIndex(topSiblingIndex);
break;
case TooltipTypes.hpup:
this.setupLabel("hpup", "num", "+" + this.value);
this.node.setPosition(v3(this.node.position.x, this.node.position.y - 60));
this.node.setPosition(v3(this.node.position.x, currentY - 60));
this.node.setSiblingIndex(topSiblingIndex);
break;
case TooltipTypes.shield:
this.node.setPosition(v3(this.node.position.x + offsetX, currentY));
this.node.setSiblingIndex(topSiblingIndex);
this.setupLabel("add_life", "hp", this.value);
break;