Skip to content

Commit 2fb10d3

Browse files
committed
docs(samples): update PlaytimeReporter example to use WaitForSecondsRealtime
Changed the PlaytimeReporter coroutine in the Assets/Unity example to use WaitForSecondsRealtime instead of WaitForSeconds. This ensures that playtime reporting continues even when the game is paused (Time.timeScale = 0).
1 parent 600d945 commit 2fb10d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

assets/unity/PlaytimeReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private IEnumerator ReportCoroutine()
5151
{
5252
while (true)
5353
{
54-
yield return new WaitForSeconds(_reportIntervalSeconds);
54+
yield return new WaitForSecondsRealtime(_reportIntervalSeconds);
5555
double hoursPlayed = (DateTime.UtcNow - _lastReportTime).TotalHours;
5656
_lastReportTime = DateTime.UtcNow;
5757

0 commit comments

Comments
 (0)