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

I am unable to quit unity screen and get back to Flutter native screen . Unity screen is always in background. Is it possible to kill unit scene . #470

Closed
suryanadiminti99 opened this issue Oct 7, 2021 · 5 comments

Comments

@suryanadiminti99
Copy link

suryanadiminti99 commented Oct 7, 2021

I am unable to quit unity screen and get back to Flutter native screen . Unity screen is always in background. Is it possible to kill unit scene . And I want to go back to native screen.

I added below code for click on the back button . Here app is going back my native screen . But again i go to AR screen , the previous data is appears in AR scene.

Navigator.pop(context);

If i add below code app was crashed.

_unityWidgetController.unload().then((value) => Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => HomeActivity()),
(Route route) => false,
));

If I add below code , my entire app was quit.

_unityWidgetController.quit();

Any one please suggest some solution for this .
Thankyou

@juicycleff @thomas-stockx @krispypen @xcxooxl

@suryanadiminti99 suryanadiminti99 changed the title I am unable to quite unity screen and get back to Flutter native screen . Unity screen is always in background. Is it possible to kill unit scene . I am unable to quit unity screen and get back to Flutter native screen . Unity screen is always in background. Is it possible to kill unit scene . Oct 7, 2021
@juicycleff
Copy link
Owner

I'm sorry it is a limitation with the unity player

@suryanadiminti99
Copy link
Author

Okay , Thankyou . Is there any way to kill unity before going to native screen? Any idea please .

@suryanadiminti99
Copy link
Author

suryanadiminti99 commented Oct 8, 2021

Actually what we are doing here for temporary purpose, We are destroying all unity data and deleting 3D assets from AR scene . Now we are reset the unity scene . So now native side we are using this Navigator.pop(context); for closing the unity Widget screen . It is working if we have simple 3D assets in AR . If the 3D content is high, the destroy process will suddenly stopped and app was closed. This is the way we are doing .

@NileshTech
Copy link

Hello everyone. First of all, thanks to the team who developed this plugin. and it helped me a lot to think in different wy for two technologies. I need a help to control multiple games in single app. So is there any way to control the unity scene with help of sceneManager function? If yes, how to do it?

@suryanadiminti99
Copy link
Author

Yes, It is possible. Maintain multiple unity scenes in single projects . When you click on each game send one unique key to unity using Unity Send Message . Based on that key redirect to related unity scene . So that you can open different game in single application in one Unity Project.

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

3 participants