this is problem. how can i save the time when the player exit the game, and how i read again the time when the app is start again, i want to add 1 live every hour the player doesn’t play the game?
Save the time when the player exit the game and how i read again the time when the app is start again
“How can i save the time when the player exit the game”
If he exits the game with a “quit” button, you can just save the time at this moment. But if he kills the game, this is not going to work. What you can do is a timer, and while the player is playing, you save the current time each xxx timeStep. The result won’t be perfect but closed of what you want. This is the only way I know, but check if Unity has a feature for this.
“How i read again the time when the app is start again”
You are supposed to save the current time each xxx timeStep when the player is playing, so at the next play, this time you saved is in fact the last time where the player was playing. Get this “last connexion time” when the game starts again, and make the difference with the actually current time to know how much time passed since the last game.
Read tutorials about saving game data if you have never done this before.