mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
do not write legacy navmeshes container when visiting a scene
This commit is contained in:
@@ -584,12 +584,16 @@ impl Scene {
|
||||
let _ = self.sky_box.visit("SkyBox", &mut region);
|
||||
|
||||
// Backward compatibility.
|
||||
let mut navmeshes = NavMeshContainer::default();
|
||||
if navmeshes.visit("NavMeshes", &mut region).is_ok() {
|
||||
for (i, navmesh) in navmeshes.iter().enumerate() {
|
||||
NavigationalMeshBuilder::new(BaseBuilder::new().with_name(format!("Navmesh{i}")))
|
||||
if region.is_reading() {
|
||||
let mut navmeshes = NavMeshContainer::default();
|
||||
if navmeshes.visit("NavMeshes", &mut region).is_ok() {
|
||||
for (i, navmesh) in navmeshes.iter().enumerate() {
|
||||
NavigationalMeshBuilder::new(
|
||||
BaseBuilder::new().with_name(format!("Navmesh{i}")),
|
||||
)
|
||||
.with_navmesh(navmesh.clone())
|
||||
.build(&mut self.graph);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user