瀏覽代碼

Fixed signal animation_finished

The signal animation_finished is now fired after all values have been changed so changes to the animation can be done without animation_finished without generating unexpected behavior.
zer0problem 6 年之前
父節點
當前提交
1c75603ff5
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scene/2d/animated_sprite.cpp

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

@@ -398,11 +398,11 @@ void AnimatedSprite::_notification(int p_what) {
 							emit_signal(SceneStringNames::get_singleton()->animation_finished);
 							frame = 0;
 						} else {
+							frame = fc - 1;
 							if (!is_over) {
-								emit_signal(SceneStringNames::get_singleton()->animation_finished);
 								is_over = true;
+								emit_signal(SceneStringNames::get_singleton()->animation_finished);
 							}
-							frame = fc - 1;
 						}
 					} else {
 						frame++;