浏览代码

Fix NavigationRegion3D debug mesh rendering twice in Editor

Fixes double rendering of NavigationRegion3D debug mesh due to both 3DGizmo and runtime debug rendering the mesh at the same time.
smix8 3 年之前
父节点
当前提交
0e4c31ce57
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      scene/3d/navigation_region_3d.cpp

+ 6 - 0
scene/3d/navigation_region_3d.cpp

@@ -363,6 +363,12 @@ NavigationRegion3D::~NavigationRegion3D() {
 
 #ifdef DEBUG_ENABLED
 void NavigationRegion3D::_update_debug_mesh() {
+	if (Engine::get_singleton()->is_editor_hint()) {
+		// don't update inside Editor as node 3d gizmo takes care of this
+		// as collisions and selections for Editor Viewport need to be updated
+		return;
+	}
+
 	if (!NavigationServer3D::get_singleton()->get_debug_enabled()) {
 		if (debug_instance.is_valid()) {
 			RS::get_singleton()->instance_set_visible(debug_instance, false);