Hello,
When executing AddPlayerScoreAsync via Task.Run, Unity throws an exception:
Task.Run(async () => { await LeaderboardsService.Instance.AddPlayerScoreAsync(leaderboardID, score); });
“UnityEngine.UnityException: get_unscaledTime can only be called from the main thread.”
Originating from
public bool RateLimited => Time.unscaledTime < m_rateLimitUntilUnscaledTime;
As a result, the submission is silently swallowed and never occurs.
[EDIT]
Just noticed you can happily just call async methods in Unity, as long as you don’t need the return immediately (which I don’t). So that works perfectly fine. Sorry for the confusion!
Thanks,
Chris