Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integration of react / redux and unity for web game developement

is there a way to integrate unity with react in a web application? Maybe even run the unity part in a subwindow.

So basically I want to use the unity part of the graphics and animations. If something interesting happens in the game, then the state in the react / redux is changes or some action is triggered.

It would be ideal if I could use some parts of the redux state in the unity part of the game. So access redux or some parts via handlers in unity.

Thanks a lot. I hope it is clear what I want to do.

like image 522
MichaelRazum Avatar asked Oct 29 '25 01:10

MichaelRazum


1 Answers

Yes, this is possible. I've made a library for archiving this, you can get it from here. I've added two way communication between your React and Unity content.

You can load your Unity content as following.

export class App extends React.Component {
  render () {
    return <Unity 
      src='Public/Build/myGame.json' 
      loader='Public/Build/UnityLoader.js' />
  }
}

If you have any further questions you can open an issue on the GitHub page.

like image 144
Jeffrey Lanters Avatar answered Oct 30 '25 14:10

Jeffrey Lanters



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!