diff options
author | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2018-12-06 19:03:26 -0200 |
---|---|---|
committer | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2018-12-06 19:45:47 -0200 |
commit | f69dbc09538b75b16edf519a67113ea4764ecacd (patch) | |
tree | 8bcfa1527ff12a7262df198db87463707c10b630 | |
parent | ce3f3a9f82545b71a819c32e2c134a55d9d564f2 (diff) |
Update NavPoly in the editor canvas when the resource is changed via the Inspector
-rw-r--r-- | scene/2d/navigation_polygon.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index b36924e521..9154929e0b 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -349,8 +349,6 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) { if (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()) update(); - - //update_gizmo(); } bool NavigationPolygonInstance::is_enabled() const { @@ -461,26 +459,28 @@ void NavigationPolygonInstance::_notification(int p_what) { void NavigationPolygonInstance::set_navigation_polygon(const Ref<NavigationPolygon> &p_navpoly) { - if (p_navpoly == navpoly) + if (p_navpoly == navpoly) { return; + } if (navigation && nav_id != -1) { navigation->navpoly_remove(nav_id); nav_id = -1; } + if (navpoly.is_valid()) { navpoly->disconnect(CoreStringNames::get_singleton()->changed, this, "_navpoly_changed"); } navpoly = p_navpoly; - if (navpoly.is_valid()) { navpoly->connect(CoreStringNames::get_singleton()->changed, this, "_navpoly_changed"); } + _navpoly_changed(); if (navigation && navpoly.is_valid() && enabled) { nav_id = navigation->navpoly_add(navpoly, get_relative_transform_to_parent(navigation), this); } - //update_gizmo(); + _change_notify("navpoly"); update_configuration_warning(); } |