feat: Implement selected animation handling and integrate with human mechanics
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user