diff options
author | Josh Jones <kilauea.jones@gmail.com> | 2022-09-30 23:49:39 -0600 |
---|---|---|
committer | Josh Jones <kilauea.jones@gmail.com> | 2022-12-10 12:03:06 -0800 |
commit | 5769b0e8d8db75ff500c979aa63d3f3428de526d (patch) | |
tree | ba0df7ba770e1fa1a9e3fbccd19e0cc781940bd3 /scene/2d/navigation_region_2d.cpp | |
parent | 39fe0bfdc3327d2b1f651739a918daea3ba241f5 (diff) |
Enable assigning an owner to navigation regions and links
This allows users of the server APIs to get back the nodes that created certain regions and links.
Diffstat (limited to 'scene/2d/navigation_region_2d.cpp')
-rw-r--r-- | scene/2d/navigation_region_2d.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index 13d371042b..7bf3eec79b 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -634,7 +634,9 @@ void NavigationRegion2D::_bind_methods() { NavigationRegion2D::NavigationRegion2D() { set_notify_transform(true); + region = NavigationServer2D::get_singleton()->region_create(); + NavigationServer2D::get_singleton()->region_set_owner_id(region, get_instance_id()); NavigationServer2D::get_singleton()->region_set_enter_cost(region, get_enter_cost()); NavigationServer2D::get_singleton()->region_set_travel_cost(region, get_travel_cost()); |