feat: Enhance human event handling and animation management, including state updates and monitoring
This commit is contained in:
@@ -15,6 +15,10 @@ interface HumansStore {
|
||||
setHumanActive: (modelUuid: string, isActive: boolean) => void;
|
||||
setHumanPicking: (modelUuid: string, isPicking: boolean) => void;
|
||||
setHumanLoad: (modelUuid: string, load: number) => void;
|
||||
setHumanState: (
|
||||
modelUuid: string,
|
||||
newState: HumanStatus["state"]
|
||||
) => void;
|
||||
incrementHumanLoad: (modelUuid: string, incrementBy: number) => void;
|
||||
decrementHumanLoad: (modelUuid: string, decrementBy: number) => void;
|
||||
|
||||
@@ -106,6 +110,15 @@ export const createHumanStore = () => {
|
||||
});
|
||||
},
|
||||
|
||||
setHumanState: (modelUuid, newState) => {
|
||||
set((state) => {
|
||||
const human = state.humans.find(h => h.modelUuid === modelUuid);
|
||||
if (human) {
|
||||
human.state = newState;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
incrementHumanLoad: (modelUuid, incrementBy) => {
|
||||
set((state) => {
|
||||
const human = state.humans.find(h => h.modelUuid === modelUuid);
|
||||
|
||||
Reference in New Issue
Block a user