I see posts that say that you can't exit on the iPhone and that the 'home' button does it.
But with the iPhone now doing multitasking the home button doesn't exit the game. How do I end (terminate) the game when the game is over?
Currently when one loses my game I play an end animation with repeating music. If the 'home' button is hit you back to the iOS. But if you tap the game icon you are back at the end animation and music of my game. 2 days later and tapping the game icon returns to the end of game animation and music.
One can force close the by double click of 'home' button and then tapping and holding the game icon until the '-' sign next to the running game appears. But this isn't really what is good or convenient for the user.
I want the player to be able to return to the game after the 'home' button is hit while the game is going on. But when the game is complete and after my end-game animation sequence I want to exit the game so the player can restart.
How can this be done?
it's surprising lot's of iOS programmers didn't quickly yell this answer at you!!
click build then player settings .. that's your answer! it's that simple.
You can read about this extensively..
or at Apple, long URL at Apple's docu...
scroll down to "UIApplicationExitsOnSuspend key in its Info.plist"
"I want the player to be able to return to the game after the 'home' button is hit while the game is going on. But when the game is complete and after my end-game animation sequence I want to exit the game so the player can restart."
in the iPhone universe, all of that is not possible.
(1) you cannot quit iFone apps from within the app. the user can only quit them using the plastic round button. this is an extremely basic aspect of iFone apps: as a developer, you simply cannot exit iFone apps, it's that simple. give that there are now, what 1/2 million iFone apps and 88 gazillion ifones this is well-understood and established! I guess anyone with an ifone (pad, pod, etc) understands that you cant quite an ifone app from within the app. (if you use the ridiculous trick of crashing the app, apple will simply reject it of course, if they catch the trick, or, they'll just instantly pull it from the store if someone notices later.)
(2) regarding the player returning after going to another app and playing on, that is fairly automatically handled by Unity, read the long URL above for full gory and annoying details!!