fix(hero): 移除死亡动画播放逻辑

移除 HeroSpine、HeroViewComp 和 HeroAnmComp 中与死亡动画相关的播放调用和状态检查。因为死亡动画可能已整合到其他特效或逻辑中,继续播放会导致视觉或逻辑冲突。
This commit is contained in:
panw
2026-04-01 09:15:53 +08:00
parent 62ab385f35
commit 38f0863583
3 changed files with 4 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ export default class HeroAnmComp extends Component{
private _hasStop = true;
private _atkIndex = 0;
private default_anim:string='idle'
anms:any[]=["idle","move","dead","atk0","max0","max1"]
anms:any[]=["idle","move","atk0","max0","max1"]
onLoad () {
this.anmcon=this.node.getComponent(Animation)
this.fsSprite = this.node.getComponent(FlashSprite);
@@ -28,7 +28,7 @@ export default class HeroAnmComp extends Component{
this._hasStop = true;
}
onAnimationFinished(type:Animation.EventType, state:AnimationState){
if(state.name!="idle"&&state.name!="move"&&state.name!="dead"&&state.name!="stun"){
if(state.name!="idle"&&state.name!="move"){
this.anmcon.play(this.default_anim)
}
}
@@ -64,7 +64,6 @@ export default class HeroAnmComp extends Component{
this.anmcon.play("buff")
}
dead(){
if(this.anmcon.getState("dead").isPlaying) return
this.anmcon.play("dead")
}
}

View File

@@ -67,7 +67,7 @@ export class HeroSpine extends Component {
this.anm.atked()
}
dead(){
this.anm.dead()
}
do_buff(){
this.anm.buff()

View File

@@ -414,9 +414,7 @@ export class HeroViewComp extends CCComp {
// 播放死亡特效
this.deaded();
this.as.dead();
}
realDead(){
// 🔥 修复添加model安全检查防止实体销毁过程中的空指针异常