summaryrefslogtreecommitdiffstats
path: root/scene/2d/navigation_link_2d.cpp
diff options
context:
space:
mode:
authorsmix8 <52464204+smix8@users.noreply.github.com>2023-07-06 23:01:19 +0200
committersmix8 <52464204+smix8@users.noreply.github.com>2023-07-26 01:20:15 +0200
commit69fad39cf5437b45bac2039d864605b2b63b9950 (patch)
treebe6153824e69c6ae1f8391d266a802f58630263a /scene/2d/navigation_link_2d.cpp
parent202e4b2c1e7f8b25738b93d0e4d5066453d3edf3 (diff)
downloadredot-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_link_2d.cpp')
-rw-r--r--scene/2d/navigation_link_2d.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/scene/2d/navigation_link_2d.cpp b/scene/2d/navigation_link_2d.cpp
index 3664040e7b..95798b6856 100644
--- a/scene/2d/navigation_link_2d.cpp
+++ b/scene/2d/navigation_link_2d.cpp
@@ -182,15 +182,7 @@ void NavigationLink2D::set_enabled(bool p_enabled) {
enabled = p_enabled;
- if (!is_inside_tree()) {
- return;
- }
-
- if (!enabled) {
- NavigationServer2D::get_singleton()->link_set_map(link, RID());
- } else {
- NavigationServer2D::get_singleton()->link_set_map(link, get_world_2d()->get_navigation_map());
- }
+ NavigationServer3D::get_singleton()->link_set_enabled(link, enabled);
#ifdef DEBUG_ENABLED
if (Engine::get_singleton()->is_editor_hint() || NavigationServer2D::get_singleton()->get_debug_enabled()) {