diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-05 15:42:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-05 15:42:18 +0200 |
commit | b2fcb405220cae594343c1f9dcd2f0082f1ba717 (patch) | |
tree | 09072368ea795519feb174026668fde4134c0e72 /scene/animation/tween.cpp | |
parent | 570fa6a47748ba4938c8898b1bf78a7f3aa647d3 (diff) | |
parent | a19e99aacbb6c4d6dd765510ea99ce0a9916944b (diff) |
Merge pull request #27233 from Chaosus/tween_signal
Added signal for Tween emitted at full completion
Diffstat (limited to 'scene/animation/tween.cpp')
-rw-r--r-- | scene/animation/tween.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 6a5d7839f4..23998183b8 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -223,6 +223,7 @@ void Tween::_bind_methods() { ADD_SIGNAL(MethodInfo("tween_started", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"))); ADD_SIGNAL(MethodInfo("tween_step", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"), PropertyInfo(Variant::REAL, "elapsed"), PropertyInfo(Variant::OBJECT, "value"))); ADD_SIGNAL(MethodInfo("tween_completed", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"))); + ADD_SIGNAL(MethodInfo("tween_all_completed")); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "repeat"), "set_repeat", "is_repeat"); ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_tween_process_mode", "get_tween_process_mode"); @@ -628,8 +629,10 @@ void Tween::_tween_process(float p_delta) { } pending_update--; - if (all_finished) + if (all_finished) { set_active(false); + emit_signal("tween_all_completed"); + } } void Tween::set_tween_process_mode(TweenProcessMode p_mode) { |