import { Canvas, useFrame, useThree } from '@react-three/fiber'; import { KeyboardControls, Stats } from '@react-three/drei'; import { action } from 'mobx'; import { chartRef } from './chartRef'; function RenderInfoUpdater() { const { gl } = useThree(); useFrame(action(() => { const { calls, triangles } = gl.info.render; const shaders = gl.info.programs?.length ?? 0; const { geometries, textures } = gl.info.memory; state.setRenderInfo({ calls, triangles, shaders, geometries, textures, }); })); return null; } import { observer } from 'mobx-react-lite'; import { state } from '../state'; import { GameView } from './GameView'; import { SceneEditorView } from './SceneEditorView'; import { JoystickView } from './JoystickView'; import type { RefObject } from 'react'; const IconStop = () => ; const IconPause = () => ; const IconPlay = () => ; export const ThreeView = observer(function () { const isGame = state.isGamePlaying; return (
state.worldEditor.resetSelection()} > } /> {isGame ? : } {isGame && }
{ state.game ? <> { state.game!.isPaused ? : } : }
) });