瀏覽代碼

Hide CSGShape's debug_collision_shape when it is invisible

jsjtxietian 1 年之前
父節點
當前提交
173e2c7f29
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules/csg/csg_shape.cpp

+ 5 - 0
modules/csg/csg_shape.cpp

@@ -573,6 +573,11 @@ void CSGShape3D::_notification(int p_what) {
 				// Update this node's parent only if its own visibility has changed, not the visibility of parent nodes
 				parent_shape->_make_dirty();
 			}
+			if (is_visible()) {
+				_update_debug_collision_shape();
+			} else {
+				_clear_debug_collision_shape();
+			}
 			last_visible = is_visible();
 		} break;