Update NavigationRegion2D when polygons of NavigationPolygon change
Updates NavigationRegion2D when the NavigationPolygon emits its 'changed' signal due to e.g. polygons altered by script.
This commit is contained in:
parent
7ea8cde983
commit
4035a4103c
1 changed files with 3 additions and 0 deletions
|
@ -509,6 +509,9 @@ void NavigationRegion2D::_navpoly_changed() {
|
||||||
if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())) {
|
if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())) {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
if (navpoly.is_valid()) {
|
||||||
|
NavigationServer2D::get_singleton()->region_set_navpoly(region, navpoly);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void NavigationRegion2D::_map_changed(RID p_map) {
|
void NavigationRegion2D::_map_changed(RID p_map) {
|
||||||
if (enabled && get_world_2d()->get_navigation_map() == p_map) {
|
if (enabled && get_world_2d()->get_navigation_map() == p_map) {
|
||||||
|
|
Loading…
Reference in a new issue