diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2024-02-29 15:27:10 +0100 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2024-02-29 15:45:43 +0100 |
commit | 785b5f4574a0c182dc7df7fd14bd6554800cbabe (patch) | |
tree | da7f02db7055754d9431e1cb7057a4ea428de8b2 | |
parent | 7d2ca2d8ac49cde9767e00b70f9eaf1920eb266d (diff) | |
download | redot-engine-785b5f4574a0c182dc7df7fd14bd6554800cbabe.tar.gz |
Fix NavigationObstacle3D debug not reacting to visiblity changes
Fixes NavigationObstacle3D debug not reacting to visiblity changes.
-rw-r--r-- | scene/3d/navigation_obstacle_3d.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scene/3d/navigation_obstacle_3d.cpp b/scene/3d/navigation_obstacle_3d.cpp index 82450927d3..96f7fb137c 100644 --- a/scene/3d/navigation_obstacle_3d.cpp +++ b/scene/3d/navigation_obstacle_3d.cpp @@ -132,6 +132,19 @@ void NavigationObstacle3D::_notification(int p_what) { NavigationServer3D::get_singleton()->obstacle_set_paused(obstacle, !can_process()); } 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: { if (is_inside_tree()) { _update_position(get_global_transform().origin); |