fix: Fixes signal handling on AnimationPlayer nodes. (#458)
Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
This commit is contained in:
@@ -80,12 +80,19 @@ func play(name: String, backwards: bool = false):
|
|||||||
self,
|
self,
|
||||||
"_on_animation_finished"
|
"_on_animation_finished"
|
||||||
)
|
)
|
||||||
_player_node.connect(
|
if _is_animation_player:
|
||||||
"animation_finished",
|
_player_node.connect(
|
||||||
self,
|
"animation_finished",
|
||||||
"_on_animation_finished",
|
self,
|
||||||
[name]
|
"_on_animation_finished"
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
_player_node.connect(
|
||||||
|
"animation_finished",
|
||||||
|
self,
|
||||||
|
"_on_animation_finished",
|
||||||
|
[name]
|
||||||
|
)
|
||||||
if backwards and _is_animation_player:
|
if backwards and _is_animation_player:
|
||||||
_animation_player.play_backwards(name)
|
_animation_player.play_backwards(name)
|
||||||
elif backwards:
|
elif backwards:
|
||||||
|
|||||||
Reference in New Issue
Block a user