How to store real play time, when i load game to count it and stop when i close game. Its not hard but main concern for me since its android game, how to control that when player press Home button and closes application that way. he can close game like that and it would not be saved. is there some kind of function that calls save function when that happens? Thanks
I've never tried this so not sure if it'll work, but you could look into MonoBehaviour.OnApplicationPause and MonoBehaviour.OnApplicationFocus.
on application pause is when i put application in background (when press home button or recieve call or something like that?), but what is application focus? So can someone confirm this or say which functions are called when home button is pressed (or any other action that puts game in background) ?