I am making a game with unity C#. I have code a save local and save cloud for the game. I make a button exit when pressed the game is saved and then exit.
But i have a problem in here saved game. When someone or player press the home button which on device mobile the game will exit and run in background.
If the player restart the device the game that run in background will not saved to local or cloud. This is the problem.
So in unity when home button pressed at device mobile what will unity do ? It is pause the application / game or whatever ? What can we do in unity if the player press the home button ?
If it pause the application / game could we detect it first when the player press the home button we could do saving the game ? ( i mean run a code after the button home is pressed )
Or any idea from your experience what will do if player press home button ? This is for the player to not lose the game data.
Please give the detail for me to find the solution.
Any help would be amazing for continue the game :)
Thanks
Dennis