playMaker

Author Topic: why is APPLICATION PAUSE always firing at startup?  (Read 3546 times)

friendlydog

  • Junior Playmaker
  • **
  • Posts: 65
why is APPLICATION PAUSE always firing at startup?
« on: May 21, 2015, 06:28:44 AM »
Hi,
i have a curious problem here.

When I run the game (both as app on device, or the unity player on desktop) the game initializes, the primary FSM triggers the "START" state, and then all of a sudden it fires "APPLICATION PAUSE" without finishing running through the states that are connected to the startup/init routine.

The "APPLICATION PAUSE" event is caught in the same FSM by another state that handles my pause function.

I implemented a nasty workaround that loops back to the start state chain, when the app is initializing via a bool test.  - But that's not really an acceptable solution.

So my question is: why is "APPLICATION PAUSE" automatically triggered while initializing all the time? Is this "normal" Android app behavior? or is there something else wrong with my project/the unity editor or anything abnormal?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: why is APPLICATION PAUSE always firing at startup?
« Reply #1 on: May 21, 2015, 06:41:56 AM »
Hi,

 is it only happening on android?

I think I vaguely recall someone mentionning this and I think I replied the following:

 if the behavior is 100% reliable ( a feature vs a bug... :) ), then do the following:

 maintain a bool variable "init" or something that you raise to true when receive the call, and then your logic can detect if this is the first time, in which case should ignore the call.

Bye,

 Jean

friendlydog

  • Junior Playmaker
  • **
  • Posts: 65
Re: why is APPLICATION PAUSE always firing at startup?
« Reply #2 on: May 21, 2015, 06:50:28 AM »
Hi, thanks for the superfast reply! :-)

What you suggest is what I am doing right now to handle this , so it's sort of "working" - but it's a bit too much of a bug-workaround for me.
(This problem is 100% persistent).

I'd like to get more understanding about why the "application pause" event is triggered at all, during a start up - for no reason.

But I guess if not even you know why, then nobody can help me :-)




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: why is APPLICATION PAUSE always firing at startup?
« Reply #3 on: May 21, 2015, 06:57:50 AM »
hi,

 ask on Unity forum and UA, that is important, cause this is likely a Unity thing, PlayMaker only forward information, I don't think it's something PlayMaker can do something about.

 Bye,

 Jean