فهرست منبع

Change the frame number before triggering the animation_finished signal

Gilles Roudiere 6 سال پیش
والد
کامیت
30dd1815e4
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      scene/2d/animated_sprite.cpp

+ 1 - 1
scene/2d/animated_sprite.cpp

@@ -395,8 +395,8 @@ void AnimatedSprite::_notification(int p_what) {
 					int fc = frames->get_frame_count(animation);
 					int fc = frames->get_frame_count(animation);
 					if (frame >= fc - 1) {
 					if (frame >= fc - 1) {
 						if (frames->get_animation_loop(animation)) {
 						if (frames->get_animation_loop(animation)) {
-							emit_signal(SceneStringNames::get_singleton()->animation_finished);
 							frame = 0;
 							frame = 0;
+							emit_signal(SceneStringNames::get_singleton()->animation_finished);
 						} else {
 						} else {
 							frame = fc - 1;
 							frame = fc - 1;
 							if (!is_over) {
 							if (!is_over) {