空中结束技能切换到下落动画

master
chendian 2 years ago
parent 4463bb7b9d
commit e3e9b28c45

@ -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

Loading…
Cancel
Save