瀏覽代碼

Fix error if scene has Camera at saving scene

volzhs 7 年之前
父節點
當前提交
ff68b80df7
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      scene/3d/camera.cpp

+ 4 - 1
scene/3d/camera.cpp

@@ -70,6 +70,9 @@ void Camera::_validate_property(PropertyInfo &p_property) const {
 
 
 void Camera::_update_camera() {
 void Camera::_update_camera() {
 
 
+	if (!is_inside_tree())
+		return;
+
 	Transform tr = get_camera_transform();
 	Transform tr = get_camera_transform();
 	tr.origin += tr.basis.get_axis(1) * v_offset;
 	tr.origin += tr.basis.get_axis(1) * v_offset;
 	tr.origin += tr.basis.get_axis(0) * h_offset;
 	tr.origin += tr.basis.get_axis(0) * h_offset;
@@ -81,7 +84,7 @@ void Camera::_update_camera() {
 		get_viewport()->_camera_transform_changed_notify();
 		get_viewport()->_camera_transform_changed_notify();
 	*/
 	*/
 
 
-	if (!is_inside_tree() || get_tree()->is_node_being_edited(this) || !is_current())
+	if (get_tree()->is_node_being_edited(this) || !is_current())
 		return;
 		return;
 
 
 	get_viewport()->_camera_transform_changed_notify();
 	get_viewport()->_camera_transform_changed_notify();