From f41ff64395fcf23b8f7d8d5955899d531e5abf76 Mon Sep 17 00:00:00 2001 From: walkpan Date: Sat, 16 Nov 2024 16:47:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4max=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E7=89=B9=E6=95=88=E6=9B=BF=E4=BB=A3=E5=A4=A7?= =?UTF-8?q?=E6=8B=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/hero/k1.prefab | 8 ++------ assets/resources/game/skills/buff.prefab | 3 ++- assets/resources/game/skills/buff/buff_add.anim | 10 +++++----- assets/resources/game/skills/max.prefab | 4 ++-- assets/script/game/hero/HeroSpine.ts | 14 +++----------- assets/script/game/hero/HeroViewComp.ts | 12 ++++++------ 6 files changed, 20 insertions(+), 31 deletions(-) diff --git a/assets/resources/game/hero/k1.prefab b/assets/resources/game/hero/k1.prefab index 80d19cea..a84b8770 100644 --- a/assets/resources/game/hero/k1.prefab +++ b/assets/resources/game/hero/k1.prefab @@ -293,7 +293,7 @@ "propertyPath": [ "_name" ], - "value": "max" + "value": "buff" }, { "__type__": "cc.TargetInfo", @@ -505,10 +505,6 @@ "__uuid__": "816f2261-4cea-4040-9c37-e050185991c3", "__expectedType__": "cc.AnimationClip" }, - { - "__uuid__": "fa58b1a2-2606-4fc4-89a2-e625be93ff3b", - "__expectedType__": "cc.AnimationClip" - }, { "__uuid__": "d15edf7e-7a4f-45cc-a4f2-5b8566c6ac7b", "__expectedType__": "cc.AnimationClip" @@ -598,7 +594,7 @@ "propertyPath": [ "_name" ], - "value": "buff" + "value": "max" }, { "__type__": "cc.TargetInfo", diff --git a/assets/resources/game/skills/buff.prefab b/assets/resources/game/skills/buff.prefab index 6d17e0e5..a873e28a 100644 --- a/assets/resources/game/skills/buff.prefab +++ b/assets/resources/game/skills/buff.prefab @@ -22,7 +22,7 @@ "__id__": 2 } ], - "_active": false, + "_active": true, "_components": [ { "__id__": 10 @@ -265,6 +265,7 @@ "__id__": 0 }, "fileId": "2e1WXUIxlLWLT5zBlbV6nF", + "instance": null, "targetOverrides": null } ] \ No newline at end of file diff --git a/assets/resources/game/skills/buff/buff_add.anim b/assets/resources/game/skills/buff/buff_add.anim index 4e56f2af..d2d48ef4 100644 --- a/assets/resources/game/skills/buff/buff_add.anim +++ b/assets/resources/game/skills/buff/buff_add.anim @@ -7,11 +7,11 @@ "embeddedPlayerGroups": [] }, "_native": "", - "sample": 12, + "sample": 24, "speed": 1, "wrapMode": 2, "enableTrsBlending": false, - "_duration": 0.5, + "_duration": 0.875, "_hash": 500763545, "_tracks": [ { @@ -62,11 +62,11 @@ "__type__": "cc.ObjectCurve", "_times": [ 0, - 0.08333333333333333, 0.16666666666666666, - 0.25, 0.3333333333333333, - 0.4166666666666667 + 0.5, + 0.6666666666666666, + 0.8333333333333334 ], "_values": [ { diff --git a/assets/resources/game/skills/max.prefab b/assets/resources/game/skills/max.prefab index d309252e..0443b955 100644 --- a/assets/resources/game/skills/max.prefab +++ b/assets/resources/game/skills/max.prefab @@ -127,8 +127,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 48, - "height": 32 + "width": 64, + "height": 48 }, "_anchorPoint": { "__type__": "cc.Vec2", diff --git a/assets/script/game/hero/HeroSpine.ts b/assets/script/game/hero/HeroSpine.ts index 3f084974..52a431ac 100644 --- a/assets/script/game/hero/HeroSpine.ts +++ b/assets/script/game/hero/HeroSpine.ts @@ -19,7 +19,6 @@ export class HeroSpine extends Component { animator: Animation = null!; idle_clip: AnimationClip = null!; atk_clip: AnimationClip = null!; - max_clip: AnimationClip = null!; move_clip: AnimationClip = null!; default_clip:string = ""; @@ -29,8 +28,7 @@ export class HeroSpine extends Component { LayerUtil.setNodeLayer(LayerUtil.MAP, this.node); this.idle_clip = this.animator.clips[0]; this.atk_clip = this.animator.clips[1]; - this.max_clip = this.animator.clips[2]; - this.move_clip = this.animator.clips[3]; + this.move_clip = this.animator.clips[2]; this.default_clip=this.move_clip.name; let animation = this.animator.getComponent(Animation); animation.on(Animation.EventType.FINISHED, this.onAnimationEvent, this) @@ -46,7 +44,6 @@ export class HeroSpine extends Component { } in_playing(){ if(this.animator.getState(this.atk_clip.name).isPlaying) return true; - if(this.animator.getState(this.max_clip.name).isPlaying) return true; if(this.animator.getState(this.idle_clip.name).isPlaying) return true; if(this.animator.getState(this.move_clip.name).isPlaying) return true; return false; @@ -54,8 +51,7 @@ export class HeroSpine extends Component { onAnimationEvent(type: Animation.EventType, state: AnimationState){ if(type==Animation.EventType.FINISHED){ // console.log("animator end",state.name); - if(state.name==this.atk_clip.name||state.name==this.max_clip.name){ - // console.log("animator no atk and no max"); + if(state.name==this.atk_clip.name){ this.default(); } } @@ -83,11 +79,7 @@ export class HeroSpine extends Component { } - max(){ - // console.log("do max"); - this.animator.play(this.max_clip.name); - } - + move(){ if(!this.animator.getState(this.move_clip.name).isPlaying) { console.log("doing move"); diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index d8b6d951..c06841a4 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -223,13 +223,9 @@ export class HeroViewComp extends CCComp { change_anm(){ - if (this.anm_name == "max"){ - this.as.max() - this.anm_name = "idle" - } if (this.anm_name == "atk") { this.as.atk() - this.anm_name = "max" + this.anm_name = "move" } if (this.anm_name == "move") { this.as.move() @@ -419,6 +415,10 @@ export class HeroViewComp extends CCComp { } //使用max_skill handle_skill(skill:number){ + this.node.getChildByName("max").active=true + this.scheduleOnce(()=>{ + this.node.getChildByName("max").active=false + },0.8) switch (smc.skills[skill].tg) { case 0: //自己 this.to_add_buff(this.node.getComponent(HeroViewComp),skill) @@ -464,7 +464,7 @@ export class HeroViewComp extends CCComp { console.log("cd:"+this.cd); this.as.atk(); this.scheduleOnce(()=>{ - this.handle_skill(this.sk1) + this.shoot_enemy(this.sk1) },0.4) } }