public void RankingCallback() { float verticalNormalizedPosition = 1f; if (ELSingleton <FacebookManager> .Instance.currentRanking.state == FacebookManager.FBRankingState.DONE) { loading.SetActive(value: false); if (ELSingleton <FacebookManager> .Instance.currentRanking.players.Count == 0) { Text text = Object.Instantiate(messagePrefab, content.transform); text.text = "Nobody from your friends play Word Stickers!?\nInvite your friend to compete in friend leaderboard"; itemList.Add(text.GetComponent <RectTransform>()); } int num = 0; foreach (Player player in ELSingleton <FacebookManager> .Instance.currentRanking.players) { if (num == 10 && ELSingleton <FacebookManager> .Instance.currentRanking.type == FacebookManager.FBRankingType.GLOBAL) { Text text2 = Object.Instantiate(messagePrefab, content.transform); text2.text = "..."; RectTransform component = text2.GetComponent <RectTransform>(); component.sizeDelta = new Vector2(component.sizeDelta.x, 30f); itemList.Add(component); } if (ELSingleton <FacebookManager> .Instance.currentRanking.type == FacebookManager.FBRankingType.FRIENDS) { player.rank = num + 1; } if (player.id.Equals(ELSingleton <FacebookManager> .Instance.player.id)) { verticalNormalizedPosition = 1f - 1f * (float)num / (float)(ELSingleton <FacebookManager> .Instance.currentRanking.players.Count - 1); } RankingPlayer rankingPlayer = Object.Instantiate((ELSingleton <FacebookManager> .Instance.currentRanking.type == FacebookManager.FBRankingType.FRIENDS) ? playerPrefabFB : playerPrefabNormal, content.transform); rankingPlayer.Prepare(player, ELSingleton <FacebookManager> .Instance.GetAvatarSprite(player.fbId)); itemList.Add(rankingPlayer.GetComponent <RectTransform>()); num++; } CommonButton commonButton = Object.Instantiate(inviteButton, content.transform); commonButton.Show(); commonButton.OnClick.AddListener(InviteButton); itemList.Add(commonButton.GetComponent <RectTransform>()); } else if (ELSingleton <FacebookManager> .Instance.currentRanking.state == FacebookManager.FBRankingState.ERROR) { loading.SetActive(value: false); Text text3 = Object.Instantiate(messagePrefab, content.transform); itemList.Add(text3.GetComponent <RectTransform>()); } else { loading.SetActive(value: true); } float y = UpdateLayout(); RectTransform component2 = content.GetComponent <RectTransform>(); component2.sizeDelta = new Vector2(component2.sizeDelta.x, y); scrollRect.verticalNormalizedPosition = verticalNormalizedPosition; scrollPosition = verticalNormalizedPosition; setScrollPosition = true; }