فهرست منبع

Update DebugMesh when NavMesh changes

Fixes #7371
(cherry picked from commit 2807507325c28a4b4f5128db5ee98f9a282fe5d1)
ktksgit 8 سال پیش
والد
کامیت
1bb1b6986c
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      scene/3d/navigation_mesh.cpp

+ 5 - 0
scene/3d/navigation_mesh.cpp

@@ -356,6 +356,11 @@ void NavigationMeshInstance::set_navigation_mesh(const Ref<NavigationMesh>& p_na
 	if (navigation && navmesh.is_valid() && enabled) {
 		nav_id = navigation->navmesh_create(navmesh,get_relative_transform(navigation),this);
 	}
+	
+	if (debug_view && navmesh.is_valid()) {
+		debug_view->cast_to<MeshInstance>()->set_mesh( navmesh->get_debug_mesh() );
+	}
+	
 	update_gizmo();
 	update_configuration_warning();