| 213 | IMPLEMENT_ENGINE_SETTINGS_GETTER(NavigationSettings, Navigation); |
| 214 | |
| 215 | void NavigationSettings::Apply() |
| 216 | { |
| 217 | // Cache areas properties |
| 218 | for (auto& area : NavAreas) |
| 219 | { |
| 220 | if (area.Id < DT_MAX_AREAS) |
| 221 | { |
| 222 | NavMeshRuntime::NavAreasCosts[area.Id] = area.Cost; |
| 223 | #if COMPILE_WITH_DEBUG_DRAW |
| 224 | NavMeshRuntime::NavAreasColors[area.Id] = area.Color; |
| 225 | #endif |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | #if USE_EDITOR |
| 230 | if (!Editor::IsPlayMode && Editor::Managed && Editor::Managed->CanAutoBuildNavMesh()) |
| 231 | { |
| 232 | // Rebuild all navmeshs after apply changes on navigation |
| 233 | for (auto scene : Level::Scenes) |
| 234 | { |
| 235 | Navigation::BuildNavMesh(scene); |
| 236 | } |
| 237 | } |
| 238 | #endif |
| 239 | } |
| 240 | |
| 241 | #if USE_EDITOR |
| 242 |
nothing calls this directly
no test coverage detected