Cant find any Exit on Suspend in Unity 5.2
I want to call a function when my ios app exits.
In this link I read i need to tick 'Exit on susend' to get OnApplicationQuit. But i dont find any such boolean in player settings of ios.
Please help me out
Answer by Dibbie · Nov 19, 2015 at 09:21 AM
Its a scripting thing:
void OnApplicationQuit(){ print("See you next math class lecture!"); }
Im not 100% certain, but I think the OnApplicationQuit/OnApplicationExit whatever it is, is the last function to be fired before the Unity process on any device actually ends, so... Youd have to do whatever your trying to do by a script that remains active before the player wants to exit.
Please once go through the link http://docs.unity3d.com/ScriptReference/$$anonymous$$onoBehaviour.OnApplicationQuit.html There it was specified that for ios 'Exit on Suspend' should be selected.
Answer by Dibbie · Nov 19, 2015 at 03:01 PM
Ah my bad, I misunderstood you...
So, I think what threw you off is Unity saying "tick" you assume it must be a toggle thing, its actually in a dropdown.
Under "Other Settings", about half way down, "Behavior In Background" is set to Suspend by default, their saying to just set that to Exit instead.
[Picture below for reference] http://puu.sh/lr9TY/cdfd558e11.png