diff --git a/example/src/usePlatformHook/useStateMachine.ts b/example/src/usePlatformHook/useStateMachine.ts index 4f6743b..455c985 100644 --- a/example/src/usePlatformHook/useStateMachine.ts +++ b/example/src/usePlatformHook/useStateMachine.ts @@ -20,7 +20,8 @@ export const useStateMachine = ({ const lastTriggeredModeRef = useRef(null); useEffect(() => { - const { gameStatus, scoreManager } = gameManager; + const gameStatus = gameManager.gameStatus; + const scoreManager = gameManager.scoreManager; if (gameStatus !== "started") return; @@ -62,7 +63,7 @@ export const useStateMachine = ({ onModeChange(currentTransition.targetMode); gameManager.changeGameMode({ gameMode: currentTransition.targetMode }); } - }, [scoreManager.currentCount, gameMode, gameManager, scenario, gameStatus, scoreManager.score]); + }, [gameManager.scoreManager.currentCount, gameMode, gameManager, scenario, gameManager.gameStatus, gameManager.scoreManager.score]); useEffect(() => { lastTransitionIndexRef.current = -1;