Skip to content

Mix pure js and react js #277

Answered by MusoAga
MusoAga asked this question in Help Wanted!
Discussion options

You must be logged in to vote

Well, I created a global variable for the unityinstance inside a script and set it in react with the UnityContext.

setTimeout(() => {
      window.unityInstance = unityContext.unityInstance;
    }, 2000);

I tried to use the loaded and canvas event, but when loaded is fired, unityInstance was still null and the canvas event I did not even recevied that.

Maybe I am missing something, but for now it is working

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MusoAga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant