Beispiel #1
0
    private async void UpdateUserTitleDisplayNameWithRetry(string newName)
    {
        while (true)
        {
            try
            {
                await PlayFabLeaderboardUtil.UpdateUserTitleDisplayNameAsync(newName);

                break;
            }
            catch (Exception)
            {
                await UniTask.Delay(TimeSpan.FromSeconds(1));
            }
        }
    }
Beispiel #2
0
    private async void UpdatePlayerStatisticWithRetry(int score)
    {
        while (true)
        {
            try
            {
                await PlayFabLeaderboardUtil.UpdatePlayerStatisticAsync(TitleConstData.LeaderboardStatisticName, score);

                break;
            }
            catch (Exception)
            {
                await UniTask.Delay(TimeSpan.FromSeconds(1));
            }
        }
    }
Beispiel #3
0
    private async UniTask <List <PlayerLeaderboardEntry> > GetLeaderboardWithRetry()
    {
        var statisticName   = TitleConstData.LeaderboardStatisticName;
        var maxResultsCount = TitleConstData.LeaderboardEntryCount;

        while (true)
        {
            try
            {
                return(await PlayFabLeaderboardUtil.GetLeaderboardAsync(statisticName, maxResultsCount));
            }
            catch (Exception)
            {
                await UniTask.Delay(TimeSpan.FromSeconds(1));
            }
        }
    }