From e3e9b28c45037ed98522f518935321bf8d9e6ddb Mon Sep 17 00:00:00 2001 From: chendian <-> Date: Mon, 5 Feb 2024 03:07:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E4=B8=AD=E7=BB=93=E6=9D=9F=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E5=88=87=E6=8D=A2=E5=88=B0=E4=B8=8B=E8=90=BD=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/character/view.gd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/character/view.gd b/script/character/view.gd index 227fe41..ef2c5e9 100644 --- a/script/character/view.gd +++ b/script/character/view.gd @@ -90,7 +90,11 @@ func init(default:SpriteFrames): func reset(): sprite_frames = move_sprite_frames - play_animation("idle_loop") + if status.is_on_floor: + play_animation("idle_loop") + else: + play_animation("jump4_loop") + func run(from:StringName,to:StringName): _add_trans(from,to,"","","","",true) @@ -165,6 +169,7 @@ func _update_material(): func play_animation(animation_name:String): if not sprite_frames.has_animation(animation_name): + print("无效动画:",animation_name) return if animation_name == animation: frame = 0