Unity run in background on android


i want to create some sort of app which gives you a pet for example. Now i want its hunger value to go up over a time (even when the app is not open). because it can take a couple of hours before it is hungry. Is there a way to keep updating variables while the app is “closed” or determine in some way how much time has passed between the app was closed and reopened?

Thanks in advance! :wink:

Just store the datetime fido was last fed in a playerprefs variable. Then next time they open the app check what time it is and compare to the stored datetime