Skip to content

Commit

Permalink
Resize
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed Oct 14, 2023
1 parent 105c12c commit 2c97bee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions components/unityWeb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function UnityWeb({
}: {
url?: string;
}) {
const { unityProvider } = useUnityContext({
const { unityProvider, isLoaded, sendMessage } = useUnityContext({
loaderUrl: "/Unity/WebGL.loader.js",
dataUrl: "/Unity/WebGL.data",
frameworkUrl: "/Unity/WebGL.framework.js",
Expand Down Expand Up @@ -43,13 +43,17 @@ export default function UnityWeb({
[devicePixelRatio],
);

if (isLoaded === true) {
sendMessage("CardGameManager", "StartGetCardGame", url);
}

return (
<>
<div style={{ width: "100%", height: "100%" }}>
<Unity
unityProvider={unityProvider}
style={{ width: 1280, height: 720 }}
style={{ width: "100%", height: "100%" }}
devicePixelRatio={devicePixelRatio}
/>
</>
</div>
);
}

0 comments on commit 2c97bee

Please sign in to comment.