From 8302515cf1a05e8bf3d1d52c4f9db272da52ed47 Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 19 Mar 2026 09:43:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=8B=B1=E9=9B=84):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=BF=91=E6=88=98=E6=9C=80=E5=B0=8F=E6=94=BB=E5=87=BB=E8=B7=9D?= =?UTF-8?q?=E7=A6=BB=E5=B9=B6=E4=BF=AE=E5=A4=8D=E6=94=BB=E5=87=BB=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 meleeMinEnemyDistanceX 从 80 减少到 60,优化近战英雄攻击距离判定 - 在 HeroAnmComp 中添加 _atkIndex 变量,实现 atk0、atk1、atk2 攻击动画的循环播放 --- assets/script/game/hero/HeroAnmComp.ts | 8 +++++--- assets/script/game/hero/MoveComp.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/script/game/hero/HeroAnmComp.ts b/assets/script/game/hero/HeroAnmComp.ts index 1c3a7178..a465dea9 100644 --- a/assets/script/game/hero/HeroAnmComp.ts +++ b/assets/script/game/hero/HeroAnmComp.ts @@ -9,6 +9,7 @@ export default class HeroAnmComp extends Component{ fsSprite:FlashSprite = null!; private anmcon:any=null private _hasStop = true; + private _atkIndex = 0; private default_anim:string='Idle' anms:any[]=["idle","move","stun","dead","buff","atk0","atk1","atk2","max0","max1"] onLoad () { @@ -42,8 +43,9 @@ export default class HeroAnmComp extends Component{ } atk () { if(this.anmcon.getState("max0").isPlaying) return - // if(this.anmcon.getState("atk0").isPlaying) return - this.anmcon.play("atk0") + const atkName = `atk${this._atkIndex}` + this.anmcon.play(atkName) + this._atkIndex = (this._atkIndex + 1) % 3 } max () { if(this.anmcon.getState("max0").isPlaying) return @@ -62,4 +64,4 @@ export default class HeroAnmComp extends Component{ if(this.anmcon.getState("dead").isPlaying) return this.anmcon.play("dead") } -} \ No newline at end of file +} diff --git a/assets/script/game/hero/MoveComp.ts b/assets/script/game/hero/MoveComp.ts index e8fc4899..632ac6db 100644 --- a/assets/script/game/hero/MoveComp.ts +++ b/assets/script/game/hero/MoveComp.ts @@ -37,7 +37,7 @@ interface MoveFacConfig { @ecs.register('MoveSystem') export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate { private readonly meleeAttackRange = HeroDisVal[HType.Melee]; - private readonly meleeMinEnemyDistanceX = 80; + private readonly meleeMinEnemyDistanceX = 60; private readonly meleeOvertakeSpeedGap = 20; private readonly allySpacingX = 40; private readonly allyOverlapSpacingX = 14;