update: add a physic scenne

This commit is contained in:
2026-04-17 10:48:18 +02:00
parent b26da614f0
commit ed7681a293
23 changed files with 2052 additions and 218 deletions
+18
View File
@@ -0,0 +1,18 @@
import { useEffect, useState } from "react";
import {
InteractionManager,
type InteractionSnapshot,
} from "@/stateManager/InteractionManager";
export function useInteraction(): InteractionSnapshot {
const manager = InteractionManager.getInstance();
const [state, setState] = useState<InteractionSnapshot>(manager.getState());
useEffect(() => {
return manager.subscribe(() => {
setState({ ...manager.getState() });
});
}, [manager]);
return state;
}