started storage to human
This commit is contained in:
@@ -5,12 +5,14 @@ import { useSceneContext } from "../../../../scene/sceneContext";
|
|||||||
import { useProductContext } from "../../../products/productContext";
|
import { useProductContext } from "../../../products/productContext";
|
||||||
|
|
||||||
export function useRetrieveHandler() {
|
export function useRetrieveHandler() {
|
||||||
const { materialStore, armBotStore, vehicleStore, storageUnitStore, productStore } = useSceneContext();
|
const { materialStore, armBotStore, vehicleStore, storageUnitStore, productStore, humanStore, assetStore } = useSceneContext();
|
||||||
const { selectedProductStore } = useProductContext();
|
const { selectedProductStore } = useProductContext();
|
||||||
const { addMaterial } = materialStore();
|
const { addMaterial } = materialStore();
|
||||||
const { getModelUuidByActionUuid, getPointUuidByActionUuid, getEventByModelUuid, getActionByUuid } = productStore();
|
const { getModelUuidByActionUuid, getPointUuidByActionUuid, getEventByModelUuid, getActionByUuid } = productStore();
|
||||||
const { getStorageUnitById, getLastMaterial, updateCurrentLoad, removeLastMaterial } = storageUnitStore();
|
const { getStorageUnitById, getLastMaterial, updateCurrentLoad, removeLastMaterial } = storageUnitStore();
|
||||||
const { getVehicleById, incrementVehicleLoad, addCurrentMaterial } = vehicleStore();
|
const { getVehicleById, incrementVehicleLoad, addCurrentMaterial } = vehicleStore();
|
||||||
|
const { getHumanById, incrementHumanLoad, addCurrentMaterial: addCurrentMaterialToHuman } = humanStore();
|
||||||
|
const { getAssetById } = assetStore();
|
||||||
const { selectedProduct } = selectedProductStore();
|
const { selectedProduct } = selectedProductStore();
|
||||||
const { getArmBotById, addCurrentAction } = armBotStore();
|
const { getArmBotById, addCurrentAction } = armBotStore();
|
||||||
const { isPlaying } = usePlayButtonStore();
|
const { isPlaying } = usePlayButtonStore();
|
||||||
@@ -293,6 +295,16 @@ export function useRetrieveHandler() {
|
|||||||
retrievalTimeRef.current.delete(actionUuid);
|
retrievalTimeRef.current.delete(actionUuid);
|
||||||
retrievalTimeRef.current.delete(`${actionUuid}_last`);
|
retrievalTimeRef.current.delete(`${actionUuid}_last`);
|
||||||
}
|
}
|
||||||
|
} else if (triggeredModel.type === 'human') {
|
||||||
|
const human = getHumanById(triggeredModel.modelUuid);
|
||||||
|
const humanAsset = getAssetById(triggeredModel.modelUuid);
|
||||||
|
|
||||||
|
if (humanAsset && humanAsset.animationState?.current === 'idle') {
|
||||||
|
if (human && !human.isScheduled && human.state === 'idle' && human.currentLoad < human.point.action.loadCapacity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user