Hi everyone,
I'm getting an head scratching bug for a few days.
My react-native app uses the unityView at several places. I can open it at every place without issues, but when I'm trying to open it two times in a row (either at the same place or different places), the screen freezes.
The screen displays the last frame that unity rendered before closing Unity.
The strangest thing is that the unityView is still running : I can ear the sounds and even click on buttons (if I remember where they are 😄)
The issue looks similar to open issues in the former module like this one for instance .
The former fix seemed to be this, but doesn't work here.
<UnityView style={{ position: 'absolute', left: 0, right: 0, top: 1, bottom: 1 }} />
Relevant code for the modal on RN side :
`class UnityModalComponent extends Component {
constructor(props) {
super(props);
const { route } = props;
this.state = {
renderUnity: true,
currentScene: route.params?.data?.scene,
};
this.shouldWait = false;
}
componentDidMount() {
const { currentScene } = this.state;
StatusBar.setHidden(true);
UnityModule.isReady().then(ready => {
if (ready) {
this.shouldWait = false;
UnityModule.postMessageToUnityManager(currentScene);
} else {
this.shouldWait = true;
}
});
}
componentDidUpdate(prevProps, prevState) {
const { renderUnity } = this.state;
if (renderUnity !== prevState.renderUnity && !renderUnity) {
const { navigation } = this.props;
navigation.pop();
}
}
componentWillUnmount() {
StatusBar.setHidden(false);
}
Did anyone encounter the issue or has any idea on how to fix this?
Thank you,