Skip to content

Is there any convinent way to sync data between unity and react? #51

Answered by KurtGokhan
imwangji asked this question in Q&A
Discussion options

You must be logged in to vote

Hey. Do not worry, your question is very valid and was asked many times. It is a topic that should be in the documentation but I didn't have time to do it yet.

  1. Currently, this is the way to do it. If you want to make it shorter, you can assign it to a variable, or add DemoManagerScript directly to the globals, like this:

  1. If you want your changes to Globals to cause a rerender, you need to use useGlobals.

However, this will only rerender on changes to the Globals itself, not its nested properties. For example, if you change username of DemoManagerScript, it won't cause a rerender. To do that, you can set it in Globals manually like Globals["username"] = username.

But there is also a m…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@imwangji
Comment options

Answer selected by imwangji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants