fix(技能动画): 修复技能"光箭"的动画触发和播放冲突
- 将技能配置中的动作类型从"atk"改为"max",以匹配英雄动画组件的逻辑 - 在动画组件中添加通用的`play`方法,并统一检查"max0"和"max1"动画的播放状态 - 防止多个动画同时播放导致的冲突问题
This commit is contained in:
@@ -233,7 +233,7 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
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%攻击的伤害",
|
||||
|
||||
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user