-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import path from 'path'; | ||
import Unity, {UnityContext} from 'react-unity-webgl'; | ||
import {createStyles, makeStyles, Theme} from '@material-ui/core/styles'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => | ||
createStyles({ | ||
unity: { | ||
width: '50vw', | ||
height: '50vh', | ||
} | ||
}), | ||
); | ||
export default function Dice() { | ||
const classes = useStyles(); | ||
const buildUrl = 'WebGL/Build'; | ||
// const buildUrl = 'http://localhost:8080/WebGL/Build'; | ||
const unityContext = new UnityContext({ | ||
loaderUrl: `${buildUrl}/WebGL.loader.js`, | ||
dataUrl: `${buildUrl}/WebGL.data`, | ||
frameworkUrl: `${buildUrl}/WebGL.framework.js`, | ||
codeUrl: `${buildUrl}/WebGL.wasm`, | ||
streamingAssetsUrl: "StreamingAssets", | ||
companyName: "DefaultCompany", | ||
productName: "DiceGame", | ||
productVersion: "0.1", | ||
}); | ||
return ( | ||
<Unity | ||
unityContext={unityContext} | ||
className={classes.unity} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# `WebGL 임시 설정` | ||
**public 폴더 안에 WebGL 폴더 배치 후 yarn dev 실행** |