new human event mangaer
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useResetButtonStore } from '../../../../../store/usePlayButtonStore';
|
||||
import { useFrame } from '@react-three/fiber'
|
||||
import { useSceneContext } from '../../../../scene/sceneContext';
|
||||
import { useProductContext } from '../../../products/productContext';
|
||||
// import { findConveyorSubsequence } from '../../../simulator/functions/getConveyorSequencesInProduct';
|
||||
|
||||
function ConveyorInstance({ conveyor }: { readonly conveyor: ConveyorStatus }) {
|
||||
|
||||
const { materialStore, conveyorStore, productStore } = useSceneContext();
|
||||
const { getProductById } = productStore();
|
||||
const { selectedProductStore } = useProductContext();
|
||||
const { selectedProduct } = selectedProductStore();
|
||||
const { getMaterialsByCurrentModelUuid, materials } = materialStore();
|
||||
const { isReset } = useResetButtonStore();
|
||||
const { getMaterialsByCurrentModelUuid } = materialStore();
|
||||
const { setConveyorPaused } = conveyorStore();
|
||||
|
||||
useEffect(() => {
|
||||
useFrame(() => {
|
||||
const product = getProductById(selectedProduct.productUuid);
|
||||
if (!product) return;
|
||||
|
||||
const conveyorMaterials = getMaterialsByCurrentModelUuid(conveyor.modelUuid);
|
||||
if (conveyorMaterials && conveyorMaterials?.length > 0) {
|
||||
if (conveyorMaterials && conveyorMaterials.length > 0) {
|
||||
|
||||
const hasPausedMaterials = conveyorMaterials.some(material => material.isPaused);
|
||||
|
||||
@@ -52,7 +52,7 @@ function ConveyorInstance({ conveyor }: { readonly conveyor: ConveyorStatus }) {
|
||||
// }
|
||||
// });
|
||||
|
||||
}, [materials, conveyor.modelUuid, getMaterialsByCurrentModelUuid, setConveyorPaused, isReset, selectedProduct.productUuid, getProductById]);
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
// console.log('conveyor: ', conveyor);
|
||||
@@ -61,7 +61,7 @@ function ConveyorInstance({ conveyor }: { readonly conveyor: ConveyorStatus }) {
|
||||
return (
|
||||
<>
|
||||
</>
|
||||
)
|
||||
};
|
||||
);
|
||||
}
|
||||
|
||||
export default ConveyorInstance
|
||||
Reference in New Issue
Block a user