From 2d6e8de164f4eec7eaff221d06c5b44d1d744c04 Mon Sep 17 00:00:00 2001 From: panw Date: Mon, 21 Jul 2025 14:49:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=AA=E7=89=A9=E6=94=BB=E5=87=BB=E5=90=8E?= =?UTF-8?q?=E4=B8=8D=E8=B5=B0=E8=B7=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script/game/hero/HeroAnmComp.ts | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/assets/script/game/hero/HeroAnmComp.ts b/assets/script/game/hero/HeroAnmComp.ts index 023b26a2..2088b6fb 100644 --- a/assets/script/game/hero/HeroAnmComp.ts +++ b/assets/script/game/hero/HeroAnmComp.ts @@ -18,23 +18,23 @@ export default class HeroAnmComp extends Component{ this.is_spine=true this.spine=this.getComponent('sp.Skeleton') as sp.Skeleton; var spine = this.spine = this.getComponent('sp.Skeleton') as sp.Skeleton; - if(this.node.parent.getComponent(HeroViewComp).fac==1){ - console.log('hero parent',this.node.parent.getComponent(HeroViewComp)) - this._setMix('Walking', 'Idle'); - this._setMix('Walking', 'Attacking'); - this._setMix('Walking', 'Taunt'); - this._setMix('Idle', 'Attacking'); - this._setMix('Idle', 'Taunt'); - this._setMix('Idle', 'Walking'); - this._setMix('Attacking', 'Idle'); - this._setMix('Attacking', 'Walking'); - this._setMix('Taunt', 'Walking'); - this._setMix('Taunt', 'Idle'); - } + // if(this.node.parent.getComponent(HeroViewComp).fac==FacSet.HERO){ + // console.log('hero parent',this.node.parent.getComponent(HeroViewComp)) + // this._setMix('Walking', 'Idle'); + // this._setMix('Walking', 'Attacking'); + // this._setMix('Walking', 'Taunt'); + // this._setMix('Idle', 'Attacking'); + // this._setMix('Idle', 'Taunt'); + // this._setMix('Idle', 'Walking'); + // this._setMix('Attacking', 'Idle'); + // this._setMix('Attacking', 'Walking'); + // this._setMix('Taunt', 'Walking'); + // this._setMix('Taunt', 'Idle'); + // } spine.setCompleteListener((trackEntry) => { var animationName = trackEntry.animation ? trackEntry.animation.name : ""; if (animationName === 'Attacking'||animationName==='Taunt'||animationName==='Hurt') { - this.spine!.clearTrack(1); + this.idle() } var loopCount = Math.floor(trackEntry.trackTime / trackEntry.animationEnd); // console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex, animationName, loopCount); @@ -106,21 +106,21 @@ export default class HeroAnmComp extends Component{ if(!this.is_spine) { this.anm?.play('atk') }else{ - this.spine?.setAnimation(1, 'Attacking', false); + this.spine?.setAnimation(0, 'Attacking', false); } } max () { if(!this.is_spine) { this.anm?.play('atk') }else{ - this.spine?.setAnimation(1, 'Taunt', false); + this.spine?.setAnimation(0, 'Taunt', false); } } atked () { if(!this.is_spine) { this.anm?.play('move') }else{ - this.spine?.setAnimation(1, 'Hurt', false); + this.spine?.setAnimation(0, 'Hurt', false); } } idle () { @@ -131,7 +131,7 @@ export default class HeroAnmComp extends Component{ if(this.node.parent.getComponent(HeroViewComp).fac==FacSet.HERO){ this.spine?.setAnimation(0, 'Idle', true); }else{ - this.spine?.setAnimation(0, 'move', true); + this.spine?.setAnimation(0, 'Walking', true); } } }