Просмотр исходного кода

Merge pull request #31360 from nekomatata/fix-error-parallax-mirroring

Fixed error in ParallaxLayer when set_mirroring is called before entering the tree
Rémi Verschelde 6 лет назад
Родитель
Сommit
5f44ee30ec
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      scene/2d/parallax_layer.cpp

+ 3 - 0
scene/2d/parallax_layer.cpp

@@ -69,6 +69,9 @@ Size2 ParallaxLayer::get_motion_offset() const {
 
 void ParallaxLayer::_update_mirroring() {
 
+	if (!is_inside_tree())
+		return;
+
 	ParallaxBackground *pb = Object::cast_to<ParallaxBackground>(get_parent());
 	if (pb) {