mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-27 10:52:41 +03:00
fix: game root link
This commit is contained in:
parent
d9b8d16f6a
commit
8fe4dfb99c
@ -27,16 +27,13 @@ const _cleanScripts = () => {
|
||||
};
|
||||
|
||||
const UnityFrame = ({ url, unityGameLoader, unityGameConfig }) => {
|
||||
// NOTE (daniel): url to unity game root
|
||||
const gameRootUrl = url.split("/index.html")[0];
|
||||
|
||||
React.useEffect(() => {
|
||||
let unityInstance;
|
||||
_loadScript(`${gameRootUrl}/${unityGameLoader}`).then(() => {
|
||||
_loadScript(`${url}/${unityGameLoader}`).then(() => {
|
||||
if (window) {
|
||||
unityInstance = window.UnityLoader.instantiate(
|
||||
"unityContainer",
|
||||
`${gameRootUrl}/${unityGameConfig}`
|
||||
`${url}/${unityGameConfig}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user