summaryrefslogtreecommitdiff
path: root/scene/3d/sprite_3d.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-17 15:28:23 +0100
committerGitHub <noreply@github.com>2021-02-17 15:28:23 +0100
commit5d8abd5bad71e667f6b612cebfeb64333d7232f6 (patch)
treea7ca9886c629a2e81c0292cfcdb2efa2b919c741 /scene/3d/sprite_3d.cpp
parentab4f5c0668d2c90055f66f9fde98b4deecb19128 (diff)
parentc3be0c2c041656bf18aa7aef51a9bf671f0fbd21 (diff)
Merge pull request #40316 from jiteshvm/missing-animatedsprite3d-signals
adding animation_finished signal and fix frame_changed signal not firing
Diffstat (limited to 'scene/3d/sprite_3d.cpp')
-rw-r--r--scene/3d/sprite_3d.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index c26224d0e3..cb2df9130f 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -888,11 +888,13 @@ void AnimatedSprite3D::_notification(int p_what) {
} else {
frame = fc - 1;
}
+ emit_signal(SceneStringNames::get_singleton()->animation_finished);
} else {
frame++;
}
_queue_update();
+ emit_signal(SceneStringNames::get_singleton()->frame_changed);
}
float to_process = MIN(timeout, remaining);
@@ -1082,6 +1084,7 @@ void AnimatedSprite3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_frame"), &AnimatedSprite3D::get_frame);
ADD_SIGNAL(MethodInfo("frame_changed"));
+ ADD_SIGNAL(MethodInfo("animation_finished"));
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames");
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation");