"use client"; import { Unity, useUnityContext } from "react-unity-webgl"; export default function Home() { const { unityProvider, isLoaded, loadingProgression } = useUnityContext({ loaderUrl: "/unity/test-project/build.loader.js", dataUrl: "/unity/test-project/build.data", frameworkUrl: "/unity/test-project/build.framework.js", codeUrl: "/unity/test-project/build.wasm", }); // We'll round the loading progression to a whole number to represent the // percentage of the Unity Application that has loaded. const loadingPercentage = Math.round(loadingProgression * 100); return ( <>
Loading... ({loadingPercentage}%)