bug fix
This commit is contained in:
@@ -5,6 +5,7 @@ import { generateSoloNavMesh } from "@recast-navigation/generators";
|
||||
import { init as initRecastNavigation } from "@recast-navigation/core";
|
||||
import { DebugDrawer, getPositionsAndIndices } from "@recast-navigation/three";
|
||||
import { useSceneContext } from "../../../scene/sceneContext";
|
||||
import { useToggleView } from "../../../../store/builder/store";
|
||||
|
||||
interface NavMeshDetailsProps {
|
||||
setNavMesh: (navMesh: any) => void;
|
||||
@@ -19,8 +20,10 @@ export default function NavMeshDetails({
|
||||
const { aisles } = aisleStore();
|
||||
const { scene } = useThree();
|
||||
const { walls } = wallStore();
|
||||
const { toggleView } = useToggleView();
|
||||
|
||||
useEffect(() => {
|
||||
if (toggleView) return;
|
||||
const initializeNavigation = async () => {
|
||||
try {
|
||||
await initRecastNavigation();
|
||||
@@ -64,7 +67,7 @@ export default function NavMeshDetails({
|
||||
};
|
||||
|
||||
initializeNavigation();
|
||||
}, [scene, groupRef, aisles, walls]);
|
||||
}, [scene, groupRef, aisles, walls, toggleView]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user