| 51 | #if USE_EDITOR |
| 52 | |
| 53 | void NavMeshBoundsVolume::OnBoundsChanged(const BoundingBox& prevBounds) |
| 54 | { |
| 55 | // Auto-rebuild modified navmesh area |
| 56 | if (IsDuringPlay() && IsActiveInHierarchy() && !Editor::IsPlayMode && Editor::Managed->CanAutoBuildNavMesh()) |
| 57 | { |
| 58 | if (_box.Intersects(prevBounds)) |
| 59 | { |
| 60 | // Bounds were moved a bit so merge into a single request (for performance reasons) |
| 61 | BoundingBox dirtyBounds; |
| 62 | BoundingBox::Merge(prevBounds, _box, dirtyBounds); |
| 63 | Navigation::BuildNavMesh(dirtyBounds, ManagedEditor::ManagedEditorOptions.AutoRebuildNavMeshTimeoutMs); |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | // Dirty each bounds in separate |
| 68 | Navigation::BuildNavMesh(prevBounds, ManagedEditor::ManagedEditorOptions.AutoRebuildNavMeshTimeoutMs); |
| 69 | Navigation::BuildNavMesh(_box, ManagedEditor::ManagedEditorOptions.AutoRebuildNavMeshTimeoutMs); |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | void NavMeshBoundsVolume::OnActiveInTreeChanged() |
| 75 | { |
nothing calls this directly
no test coverage detected