From 1f5792aa991ab586b1575ca4faebfd3d3341d8d7 Mon Sep 17 00:00:00 2001 From: walkpan Date: Mon, 3 Nov 2025 06:37:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(hero):=20=E8=B0=83=E6=95=B4=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E5=90=8E=E9=80=80=E9=80=BB=E8=BE=91=E5=92=8C=E4=BC=A4?= =?UTF-8?q?=E5=AE=B3=E6=8F=90=E7=A4=BA=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改英雄后退行为,移除英雄后退功能并增加怪物后退距离 调整伤害提示的垂直位置计算方式,使用传入的y参数 --- assets/script/game/hero/HeroViewComp.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index ae7d1dc8..82bf921b 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -211,10 +211,10 @@ export class HeroViewComp extends CCComp { } /** 血量提示(伤害数字) */ - private hp_tip(type: number = 1, value: string = "", s_uuid: number = 1001, y: number = 90) { + private hp_tip(type: number = 1, value: string = "", s_uuid: number = 1001, y: number = 100) { let tip = ecs.getEntity(Tooltip); let x = this.node.position.x; - let ny = this.node.getComponent(UITransform).height + 60; + let ny = this.node.getComponent(UITransform).height + y; let pos = v3(x, ny, 0); tip.load(pos, type, value, s_uuid, this.node.parent); } @@ -302,15 +302,16 @@ export class HeroViewComp extends CCComp { //后退 back(){ if(this.model.fac==FacSet.MON) { - let tx=this.node.position.x+5 + let tx=this.node.position.x+30 if(tx > 320) tx=320 tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start() } - if(this.model.fac==FacSet.HERO) { - let tx=this.node.position.x-5 - if(tx < -320) tx=-320 - tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start() - } + //英雄不再后退 + // if(this.model.fac==FacSet.HERO) { + // let tx=this.node.position.x-30 + // if(tx < -320) tx=-320 + // tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start() + // } } // 伤害计算和战斗逻辑已迁移到 HeroBattleSystem