- Home /
Delay quitting and finish some coroutines
Well, I use an IEnumerator to send my players info to the database, such as offline\online state, and position by XYZ. Now, whenever the player closes the game, the game should delay it for a few moments to make a coroutine which sends the player state and locations..But for some reason
void OnApplicationQuit()
skips methods and coroutines.. Even with :
Application.CancelQuit();
How do I send my location and state BEFORE the application quits? I know that hardware problems could make me problems too but I'm talking about situations of the player pressing alt+f4 or quits from the windows gui toolbar, etc...
Answer by SubatomicHero · Jul 01, 2013 at 01:56 PM
Within your OnApplicationQuit() I imagine you are posting to an online database? If so you are using the www class. You can yield until this is complete.
The yielding is ignored, coroutines for some reasons are ignored.. So it doesnt even matters..
Even worse, I tried to just send the link before it quits directly with no waiting for answers and no side methods which would do the function (the php link so it'll update the databse) and it ignores that also. ):