Call stop after setting new sprite frames
This commit is contained in:
@@ -316,7 +316,6 @@ void AnimatedSprite2D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
|
||||
if (frames.is_valid()) {
|
||||
frames->disconnect(CoreStringName(changed), callable_mp(this, &AnimatedSprite2D::_res_changed));
|
||||
}
|
||||
stop();
|
||||
frames = p_frames;
|
||||
if (frames.is_valid()) {
|
||||
frames->connect(CoreStringName(changed), callable_mp(this, &AnimatedSprite2D::_res_changed));
|
||||
@@ -335,6 +334,7 @@ void AnimatedSprite2D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
|
||||
}
|
||||
}
|
||||
}
|
||||
stop();
|
||||
|
||||
notify_property_list_changed();
|
||||
queue_redraw();
|
||||
|
||||
@@ -1217,7 +1217,6 @@ void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
|
||||
if (frames.is_valid()) {
|
||||
frames->disconnect(CoreStringName(changed), callable_mp(this, &AnimatedSprite3D::_res_changed));
|
||||
}
|
||||
stop();
|
||||
frames = p_frames;
|
||||
if (frames.is_valid()) {
|
||||
frames->connect(CoreStringName(changed), callable_mp(this, &AnimatedSprite3D::_res_changed));
|
||||
@@ -1236,6 +1235,7 @@ void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
|
||||
}
|
||||
}
|
||||
}
|
||||
stop();
|
||||
|
||||
notify_property_list_changed();
|
||||
_queue_redraw();
|
||||
|
||||
Reference in New Issue
Block a user