From 69fad39cf5437b45bac2039d864605b2b63b9950 Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Thu, 6 Jul 2023 23:01:19 +0200 Subject: Add NavigationServer API to enable regions and links Adds NavigationServer API to enable regions and links. --- scene/2d/navigation_link_2d.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'scene/2d/navigation_link_2d.cpp') 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()) { -- cgit v1.2.3