Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props) {
super(props);
this.speed = 30;
this.state = { rotation: 0, unityShouldBeMounted: true };
this.unityContent = new UnityContent(
"unity_project_build/Build.json",
"unity_project_build/UnityLoader.js"
);
this.unityContent.on("Say", message => {
console.log("Wow Unity said: " + message);
});
this.unityContent.on("SendRotation", rotation => {
this.setState({ rotation: Math.round(rotation) });
});
this.unityContent.on("progress", progression => {
console.log("Unity progress", progression);
});