css minor fix
This commit is contained in:
parent
76730c24b8
commit
ed5134f7ec
|
|
@ -1,8 +1,8 @@
|
|||
"use client";
|
||||
import Image from "next/image";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { Suspense } from "react";
|
||||
import { Unity, UnityConfig, useUnityContext } from "react-unity-webgl";
|
||||
|
||||
const unityConfigBuilder: (path: string) => UnityConfig = (path) => ({
|
||||
loaderUrl: `${path}.loader.js`,
|
||||
dataUrl: `${path}.data`,
|
||||
|
|
@ -19,7 +19,7 @@ const option = [
|
|||
{ value: "/unity/test-project/build", name: "test-project" },
|
||||
];
|
||||
|
||||
export default function Home() {
|
||||
function UnityComponent() {
|
||||
const params = useSearchParams();
|
||||
const p = params.get("p");
|
||||
console.log(p);
|
||||
|
|
@ -41,15 +41,14 @@ export default function Home() {
|
|||
새 Unity 프로젝트를 생성하고, WebGL로 빌드 후 빌드 산출물을
|
||||
react-unity-webgl 라이브러리를 통해 실행했다.
|
||||
</div>
|
||||
<div className="relative h-[600px] w-[800px]">
|
||||
<div className="flex h-[650px] w-[800px] flex-col">
|
||||
{isLoaded === false && (
|
||||
<div className="absolute left-0 top-0 flex h-full w-full items-center justify-center bg-gray-500">
|
||||
<div className="absolute z-10 flex h-[600px] w-[800px] items-center justify-center bg-gray-500">
|
||||
<p>Loading... ({loadingPercentage}%)</p>
|
||||
</div>
|
||||
)}
|
||||
{initialisationError && JSON.stringify(initialisationError, null, 2)}
|
||||
<Unity className="h-full w-full" unityProvider={unityProvider} />
|
||||
<div className="flex">
|
||||
<Unity className="h-[600px] w-[800px]" unityProvider={unityProvider} />
|
||||
<div className="mt-auto flex">
|
||||
<select
|
||||
value={Number(p)}
|
||||
onChange={(e) => (location.href = `/unity?p=${e.target.value}`)}
|
||||
|
|
@ -75,3 +74,11 @@ export default function Home() {
|
|||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function UnityWrapper() {
|
||||
return (
|
||||
<Suspense>
|
||||
<UnityComponent />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue