Persistent Time Tracker
Aparat
$0.0
(no ratings)
Date |
Price |
---|---|
日時 |
価格($) |
08/29(2023) |
0.0 |
11/27(2024) |
0.0 |
Jump AssetStore
Timer, that works in the background and also while the game is closed. Can be combined with chest opening system, where player might need to wait several hours or maybe days for it to open.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.