diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-07-06 23:01:19 +0200 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-07-26 01:20:15 +0200 |
commit | 69fad39cf5437b45bac2039d864605b2b63b9950 (patch) | |
tree | be6153824e69c6ae1f8391d266a802f58630263a /scene/2d/navigation_region_2d.cpp | |
parent | 202e4b2c1e7f8b25738b93d0e4d5066453d3edf3 (diff) | |
download | redot-engine-69fad39cf5437b45bac2039d864605b2b63b9950.tar.gz |
Add NavigationServer API to enable regions and links
Adds NavigationServer API to enable regions and links.
Diffstat (limited to 'scene/2d/navigation_region_2d.cpp')
-rw-r--r-- | scene/2d/navigation_region_2d.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index fa03713592..670a2c641c 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -42,15 +42,7 @@ void NavigationRegion2D::set_enabled(bool p_enabled) { enabled = p_enabled; - if (!is_inside_tree()) { - return; - } - - if (!enabled) { - _region_enter_navigation_map(); - } else { - _region_exit_navigation_map(); - } + NavigationServer2D::get_singleton()->region_set_enabled(region, enabled); #ifdef DEBUG_ENABLED if (Engine::get_singleton()->is_editor_hint() || NavigationServer2D::get_singleton()->get_debug_navigation_enabled()) { |