Persistent Time Tracker

Aparat

(0)
FREE
Publisher Aparat
File size 7.50kB
Number of files 6
Latest version 1
Latest release date 2023-08-29 11:57:12
First release date 2023-08-29 11:57:12
Supported Unity versions 2018.4.2 or higher

How it works:


- This time tracker persists between scenes and runs in the background. It uses a single coroutine that is started immediatly 

  when the game is launched. 

- It saves time values to JSON file and updates the file each second. 

- The script keeps track of time, even When the game is closed, so when you close and reopen the game, 

  it will take into account how much time has passed in real life and subtract it from the remaining time.

- After remaining time reaches 0 it deletes that record from JSON file and removes from tracking list.

- Current implementation works like a Timer. It requires predefined time value and it decreases it by 1 second.



Peparation:


- Create empty or attach to existing GameObject the TimeTracker script. 


IMPORTANT! Make sure the GameObejct is not a child, because it uses DontDestroyOnLoad!



Usage:


- Use TimeTracker.Instance.StartTracking and pass in the required values to begin the time tracking.

Top Publisher Assets