- Home /
Unity iOS4 Multi-Tasking Feature Support
Hi,
When I deploy for iOS 4 devices I find there's a few problems when unity work together with the iOS's multi-task features. Sometimes the background music is mute and touch control was disable when my game awakes from background process.
I guess it could because some initialization process I did with the Start() function lost its state when I hit the "home" button on iDevice, so they will not resume unless you do it manually again when I awake the game from background.
What is the underline concept for unity engine to handle those background/active swap of game state?
Is there any delegate function in unity similar to applicationDidEnterBackground: / applicationWillEnterForeground: messages that we do with XCode?
Answer by Dreamora · Oct 04, 2010 at 07:37 PM
Did you use Unity 3 Unity iPhone 1.x does not target iOS4 and has side effects due to it.
The handling for "coming back" and "going to sleep" is done through OnApplicationPause( bool pause ) :)
I'm using unity 3. Thanks for the advise but would you please explain the OnApplicationPause function a little more? If I want to restart the music when the game "co$$anonymous$$g back" from background what should I do?
@Dreamora Does OnApplication actually work (have you seen it in action)? If so, is there something you need for it to be working? Ours just doesn't get called...
Got called fine for me on iOS 4.x devices, Unity 3.x, if the function is added on a monobehaviour.
It will only work on iOS 4.0 and upwards because that is the OS version when multi-tasking was added.
Your answer
Follow this Question
Related Questions
Unity 3 and Unity iPhone Basic 1 Answer
iPhoneUtils.PlayMovie seems disabled in Unity 3 2 Answers
Flipping textures 0 Answers
Unity3 beta, iPhone publishing 3 Answers
Does Unity3 iOS support all generations of iPod/iPhone? 2 Answers