cleaner add + undo/redo state
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user