浏览代码

Fixed error in ParallaxLayer when set_mirroring is called before entering the tree

Fixes #31300

(cherry picked from commit 927a7916f659d5ddf845f02d802f7c8890824246)
PouleyKetchoupp 6 年之前
父节点
当前提交
cdd63b8d12
共有 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) {