-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot dynamically switch between builds with dynamic URLs in unityConfig #502
Labels
Comments
same issue @jeffreylanters |
@kroussea i fixed that; const _unityProvider = useDeepCompareMemo(() => {
return {
...unityProvider,
unityConfig: {
loaderUrl: `/player/${playerVersion}/Build/${playerVersion}.loader.js`,
dataUrl: `/player/${playerVersion}/Build/${playerVersion}.data${playerCompression}`,
frameworkUrl: `/player/${playerVersion}/Build/${playerVersion}.framework.js${playerCompression}`,
codeUrl: `/player/${playerVersion}/Build/${playerVersion}.wasm${playerCompression}`,
streamingAssetsUrl: `/player/${playerVersion}/StreamingAssets`,
},
};
}, [unityProvider, playerVersion,playerCompression]);
return (
<Unity
...
unityProvider={_unityProvider}
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please avoid duplicates
Language and Compiler
Babel and WebPack JavaScript
What environment are you using?
Server Side Renderering
When does your problem occur?
When the Unity App is running
What does your problem relate to?
I don't know
React-Unity-WebGL Version
9.4.0
React Version
18.2.0
Unity Version
2022.2.9f1
What happened?
Hello!
We are trying to add build versions (debug, release) of our player to our NextJS app. Essentially, we want to be able to toggle between builds on a staging or even production environment for debugging purposes, but without reloading the page if possible.
We have put our versions in the public folder like stated and both versions are able to load when the URLs are hardcoded in the useUnityContext params.
Though, it seems that we are unable to dynamically change the values after the player has loaded.
Here's a simplified example of what we're trying to achieve (just a proof of concept for now)
We can see that the values changes, but nothing in the
unityProvider.unityConfig
prop changesIs this expected? Is there a way to toggle between players without reloading the page?
Thanks!
Reproducible test case
No response
Would you be interested in contributing a fix?
The text was updated successfully, but these errors were encountered: