feat: Implement selected animation handling and integrate with human mechanics

This commit is contained in:
2025-07-03 15:18:49 +05:30
parent eb5683eadc
commit 8dd853dd03
10 changed files with 351 additions and 45 deletions

View File

@@ -146,6 +146,40 @@ export const useSelectedAction = create<SelectedActionState>()(
}))
);
interface SelectedAnimationState {
selectedAnimation: {
animationUuid: string;
animationName: string;
animationType: "behaviour" | "animatedTravel";
animation: string | null;
travelPoints?: { startPoint: [number, number, number] | null; endPoint: [number, number, number] | null; }
} | null;
setSelectedAnimation: (animation: {
animationUuid: string;
animationName: string;
animationType: "behaviour" | "animatedTravel";
animation: string | null;
travelPoints?: { startPoint: [number, number, number] | null; endPoint: [number, number, number] | null; }
}) => void;
clearSelectedAnimation: () => void;
}
export const useSelectedAnimation = create<SelectedAnimationState>()(
immer((set) => ({
selectedAnimation: null,
setSelectedAnimation: (animation) => {
set((state) => {
state.selectedAnimation = animation;
});
},
clearSelectedAnimation: () => {
set((state) => {
state.selectedAnimation = null;
});
},
}))
);
interface IsDraggingState {
isDragging: "start" | "end" | null;
setIsDragging: (state: "start" | "end" | null) => void;