From eca312ad16a30817333faa9e9e19e6b008264c36 Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 19 Mar 2026 10:42:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8A=80=E8=83=BD=E5=8A=A8=E7=94=BB):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=80=E8=83=BD"=E5=85=89=E7=AE=AD"?= =?UTF-8?q?=E7=9A=84=E5=8A=A8=E7=94=BB=E8=A7=A6=E5=8F=91=E5=92=8C=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将技能配置中的动作类型从"atk"改为"max",以匹配英雄动画组件的逻辑 - 在动画组件中添加通用的`play`方法,并统一检查"max0"和"max1"动画的播放状态 - 防止多个动画同时播放导致的冲突问题 --- assets/script/game/common/config/SkillSet.ts | 2 +- assets/script/game/hero/HeroAnmComp.ts | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index a43fc36a..bedc8a21 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -233,7 +233,7 @@ export const SkillSet: Record = { buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害", }, 6008: { - uuid:6008,name:"光箭",sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single, + uuid:6008,name:"光箭",sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"max",DTType:DTType.single, ap:100,hit_count:6,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision, buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害", diff --git a/assets/script/game/hero/HeroAnmComp.ts b/assets/script/game/hero/HeroAnmComp.ts index a465dea9..1dee75c5 100644 --- a/assets/script/game/hero/HeroAnmComp.ts +++ b/assets/script/game/hero/HeroAnmComp.ts @@ -42,22 +42,28 @@ export default class HeroAnmComp extends Component{ this.default_anim='move' } atk () { - if(this.anmcon.getState("max0").isPlaying) return + if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return const atkName = `atk${this._atkIndex}` this.anmcon.play(atkName) this._atkIndex = (this._atkIndex + 1) % 3 } max () { - if(this.anmcon.getState("max0").isPlaying) return + if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return this.anmcon.play("max0") } + play(anm:string=""){ + if(anm==="") return + if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return + this.anmcon.play(anm) + } + idle () { if(this.anmcon.getState("idle").isPlaying) return this.anmcon.play("idle") this.default_anim='idle' } buff(){ - if(this.anmcon.getState("max0").isPlaying) return + if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return this.anmcon.play("buff") } dead(){