Merge pull request #89009 from smix8/navobstacle_debug_visibility

Fix NavigationObstacle3D debug not reacting to visiblity changes
This commit is contained in:
Rémi Verschelde 2024-03-01 15:00:38 +01:00
commit d9a881b37c
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -132,6 +132,19 @@ void NavigationObstacle3D::_notification(int p_what) {
NavigationServer3D::get_singleton()->obstacle_set_paused(obstacle, !can_process()); NavigationServer3D::get_singleton()->obstacle_set_paused(obstacle, !can_process());
} break; } break;
#ifdef DEBUG_ENABLED
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_inside_tree()) {
if (fake_agent_radius_debug_instance.is_valid()) {
RS::get_singleton()->instance_set_visible(fake_agent_radius_debug_instance, is_visible_in_tree());
}
if (static_obstacle_debug_instance.is_valid()) {
RS::get_singleton()->instance_set_visible(static_obstacle_debug_instance, is_visible_in_tree());
}
}
} break;
#endif // DEBUG_ENABLED
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
if (is_inside_tree()) { if (is_inside_tree()) {
_update_position(get_global_transform().origin); _update_position(get_global_transform().origin);