cleaner add + undo/redo state

This commit is contained in:
wass08
2026-01-17 10:08:19 +09:00
parent 59be752eb4
commit 3908432225
4 changed files with 100 additions and 16 deletions
+26
View File
@@ -37,6 +37,7 @@ export default function Editor() {
<div className="w-full h-full bg-pink-50">
{/* <LevelModeSwitcher /> */}
<TestUndo />
<ActionMenu />
<Viewer>
<DraftSelector />
@@ -49,6 +50,31 @@ export default function Editor() {
);
}
const TestUndo = () => {
const {undo, redo, futureStates, pastStates} = useScene.temporal.getState();
return ( <div className="absolute top-4 right-4 z-10 flex gap-2">
<button
className="px-4 py-2 rounded bg-white"
onClick={() => {
undo();
}}
>
Undo
</button>
<button
className="px-4 py-2 rounded bg-white"
onClick={() => {
redo();
}}
>
Redo
</button>
</div>
);
}
export const Passes = ({}) => {
const { gl: renderer, scene, camera } = useThree();
const postProcessingRef = useRef(null);