public void UpdateTop10LB(string stat) { UnityAction afterGetLB = () => { Debug.Log("Update Top10 LB UI"); if (PF_GameData.currentTop10LB.Count > 0) { int count = 0; foreach (var rank in PF_GameData.currentTop10LB) { this.Top10LB.items[count].Rank.text = "" + (rank.Position + 1); this.Top10LB.items[count].Name.text = string.IsNullOrEmpty(rank.DisplayName) ? rank.PlayFabId : rank.DisplayName; this.Top10LB.items[count].Value.text = "" + rank.StatValue; count++; } if (count < 10) { for (int z = count; z < 10; z++) { this.Top10LB.items[z].Rank.text = "" + (z + 1); this.Top10LB.items[z].Name.text = string.Empty; this.Top10LB.items[z].Value.text = string.Empty; } } } }; PF_GameData.GetPlayerLeaderboard(stat, afterGetLB); }