1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Add agent pause mode to NavigationServer

Adds agent pause mode to NavigationServer.
This commit is contained in:
smix8
2023-06-15 15:35:53 +02:00
parent a83eb16fba
commit ae9dd47d0c
20 changed files with 194 additions and 26 deletions

View File

@@ -342,3 +342,23 @@ const Dictionary NavAgent::get_avoidance_data() const {
}
return _avoidance_data;
}
void NavAgent::set_paused(bool p_paused) {
if (paused == p_paused) {
return;
}
paused = p_paused;
if (map) {
if (paused) {
map->remove_agent_as_controlled(this);
} else {
map->set_agent_as_controlled(this);
}
}
}
bool NavAgent::get_paused() const {
return paused;
}