I’ve made a few test builds on my phone, and it seems when the back or home button is hit, the game stays loaded in the background and will pick up where it left off when you load it up again. How do I get my app to completely exit when the user hits one of these buttons?
With RC2 this
if (Input.GetKeyUp(KeyCode.Escape))
Application.Quit();
will accomplish exactly that.
Excellent, thank you!
Removed due to the ignorance that the Mondays caused.
Yes, if you were developing for iOS, I guess. But we are not so…
Haha. oops. Android forum. Disregard my foolishness! Mondays are hard.
Follow-up question: Will we be able to capture the back button to do other things? For instance, if you select a menu option, can the back button be intercepted to return to the previous menu?
Actually, with RC2 we will completely drop the default behavior of pressing back (ie the Activity.onBackPressed() call in Java land) and it now must be handled by the app itself. So yes, you can do whatever you want with the KeyCode.Escape event, but to somewhat emulate the old behavior you would need that code snippet above.
(After reading my previous post I noticed that I didn’t really comment on this part.)
This is actually the way you should implement it (ideally), in order to, in a way, ‘emulate’ the Android OS activity stack.
EDIT: And it is KeyCode.Menu for the menu key. ![]()
eagerly awaiting unity android nonpro
Lets hope that it will come (the non pro version for android) and is around the same pricing as unity iphone basic.
It is and it will have the price of iphone non pro (unreduced). Was already mentioned months ago ![]()
So since I allready have Unity3 pro with iphone basic, I’ll just be able to but the extra upgrade for say 300 euro and be happy ?
even if you didn’t have them and just the free unity, you could then buy android “basic” for $399 (+VAT) and be happy according the information we have, yes
feature delta likely the same as on iphone, so no umbra and higher end beast features etc on android basic