Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does UnityWidget supports restart? #829

Open
Raonshi opened this issue Jun 16, 2023 · 1 comment
Open

Does UnityWidget supports restart? #829

Raonshi opened this issue Jun 16, 2023 · 1 comment

Comments

@Raonshi
Copy link

Raonshi commented Jun 16, 2023

Hi. I'm just making flutter application which supports unity.

My flutter project has two Scaffold widget.

  • First is Main Screen. This screen has button which navigate to UnityScreen.
  • Second is Unity Screen. this screen has UnityWidget.

In this case, When I click the button in Main Screen, Unity Screen represents UnityWidget well.
But, when i click the button in Main Screen after go back to MainScreen from Unity Screen, UnityWidget was not restarted.

I tried use UnityWidgetController.unload(), UnityWidgetController.quit(). But these functions were not solution.

Is there solution for restart UnityPlayer?

@Henrik84
Copy link

It looks like that there is only for the web version a kind of restart//reload of the player.
Therefore you have to disable the cache in the Playersettings. I m currently facing the same problem. The unitycontroller is gone when you toggle from and to the unity widget again. Therefore you need a singleton instance of the unitycontroller but this is not possible at the moment. There is a pull request here which will fix it but looks not completed yet :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants