Playmaker Forum
PlayMaker Feedback => Feature Requests => Topic started by: Jos Yule on May 16, 2012, 04:49:20 PM
-
It would be great if we could have onApplicationQuit (http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnApplicationQuit.html), onApplicationPause (http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnApplicationPause.html) and onApplicationFocus (http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnApplicationFocus.html) as global events in PM.
For iOS dev, it is important to be able to react to the onApplicationPause event (and its parameter), so you can save any state you need to. This is triggered when the user receives an incoming call, or hits the HOME button.
Really, onApplicationPause is the most important to me, then onApplicationQuit and finally onApplicationFocus (i'm not at all sure of what it does or when it fires, at least on iOS).
-
Agreed, for Android too this is essential. This issue is actually the only thing our publisher is holding us back on as we can't resume to a pause menu from an interrupt. How easy would this be to implement?
-
Hi,
ok, can you try the following script? attach it to anything, an empty gameObject will do.
In your fsm, create the following Global events:
APPLICATION QUIT
APPLICATION PAUSE
APPLICATION FOCUS
What this script will do, is simply broadcast them three global events, so that any fsm can now be informed about them events.
If you have problems implementing this, let me know, and I'll do a sample
bye,
Jean
-
It works on android thankyou! Major sigh of relief. Just got to tie it in with the rest of the game and I can re-submit, honestly I can't thank you enough :D
-
Hi,
I am trying to use your script to do onapplicationpause function. However,
because of my lack of knowledge of programming and others. I am having
trouble implementing your script. If you can give me sample scene it will be
great.
Thank you.
Allen.
-
Hi,
what are you trying to do with application pause? just so that I can make a useful example for you.
bye,
Jean
-
Hi,
what are you trying to do with application pause? just so that I can make a useful example for you.
bye,
Jean
Hi,
Trying to use it for IOS - home button press/notification/incoming call/sleep button/ I guess regular stuff that will interrupt or exit/leave app.
Thank you.
Allen
-
Hi,
what are you trying to do with application pause? just so that I can make a useful example for you.
bye,
Jean
It looks like you are busy.. I will write what I did, maybe you can help me with just reply.
I put your script on empty game object and then I made new fsm in that empty game object with 3 global
event. (APPLICATION QUIT/PAUSE/FOCUS)
and after that, on one of my button(pause button) I create new state(not start state) in pause fsm with
APPLICATION PAUSE transition targeting other state with create pause menu.
is this right way to implement it? or am I missing steps.
-
Hi,
the pause will mean that your application is out, you will not be able to show anything when paused, your application will not be visible.
Does that make sense? when you press the home button, your app loose focus, and that's when APPLICATION PAUSE is called.
does that help you understand what it does?
if you want to integrate a regular pause system, then this is not what you need.
bye,
Jean
-
Hi,
the pause will mean that your application is out, you will not be able to show anything when paused, your application will not be visible.
Does that make sense? when you press the home button, your app loose focus, and that's when APPLICATION PAUSE is called.
does that help you understand what it does?
if you want to integrate a regular pause system, then this is not what you need.
bye,
Jean
Hi, Thanks! This explanation actually gave me good understanding what it does and now it all make sense when I was testing with my game. Thank you so much. Now I need to figure out way to implement my pause menu with home button pressing/interruption anyways THANK YOU.