View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.0.5
- Last updated
- First released
- Unity version
- 2022.3.29 or later
- Package size
- 116 KB
- Files
- 12
- Favorites
- 24
- Views in the past week
- 7
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- Free on
Keywords
NetworkTimeManager
Keeps track of the current DateTime regardless of the device system time.
Price Free
Get it free on Asset Store (opens in new tab)
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 2
NetworkTimeManager screenshot 1
About this asset
- Gets the time from a designated and official time server on the internet.
- The time is resynchronized if the device system time changes or if the app is paused for too long.
- Debug log messages and warnings can be disabled and are excluded from final builds.
Included in Example
- Reward buttons on timers.
- Claim a reward early by playing a simulated ad.
- Times for reward claims are saved to a binary file with the bits flipped.
- A connecting message when the network time is not in sync.
From the publisher's Asset Store listing.
Technical details
- Network settings can be changed using const member variables in the NetworkTimeManager script, such as the wait time between NTP server requests and the allowed seconds an app can be paused before resyncing the network time.
- Getting the time from an NTP server is done on a coroutine and asynchronously.
- The network time value is updated each frame.
- A single PlayerPref string saves the next request times for each NTP server to prevent too many consecutive requests.
- Exceptions are caught, logged, and handled.
Compatibility
| Unity version | Built-in | URP | HDRP | Custom |
|---|---|---|---|---|
| 6000.3.17f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.3.0f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.2.4f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.1.4f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.0.23f1 | Compatible | Compatible | Compatible | Compatible |
| 2022.3.29f1 | Compatible | Compatible | Compatible | Compatible |
As listed on the Asset Store.