private void InitPromotion() { gameOverAdventureContainer.SetActive(value: false); gameOverArenaContainer.SetActive(value: false); gameOverArena2v2Container.SetActive(value: false); //shareButton.gameObject.SetActive(PlayerDataManager.SelectedGameMode == GameMode.Adventure); promotionContainer.SetActive(value: true); if (!PlayerDataManager.IsSelectedGameModePvP) { if (MenuBase <GameEndMenu> .instance.ranks.DidLevelUp) { TankAnalytics.PlayerPromotion(ranks.ranks[ranks.ranks.Count - 1]); } int currentXp = oldXp + scoreGotten + 1; int index = (nextRank != null) ? (ranks.ranks.Count - 2) : (ranks.ranks.Count - 1); // Debug.Log("当前军衔是:"+ranks.ranks[index].name); //promotionRankText.text = ScriptLocalization.Get(ranks.ranks[index].name); promotionRankText.text = "<color=black>" + ranks.ranks[index].name; newRank.sprite = ranks.ranks[index].sprite; newRank.SetNativeSize(); SetXpBar(ranks, currentXp, promotionXpBarFill, promotionXpIndicator, promotionPrevRank, promotionNextRank, promotionXpContainer, null); if (MenuBase <GameEndMenu> .instance.nextRank != null) { float num = oldXp + scoreGotten; float num2 = (prevRank != null) ? (num - (float)prevRank.xp) : num; float num3 = (prevRank != null) ? (nextRank.xp - prevRank.xp) : nextRank.xp; float fillAmount = num2 / num3; promotionXpBarFill.fillAmount = fillAmount; Vector2 anchoredPosition = promotionXpIndicator.rectTransform.anchoredPosition; anchoredPosition.x = promotionXpBarFill.rectTransform.rect.width * promotionXpBarFill.fillAmount; promotionXpIndicator.rectTransform.anchoredPosition = anchoredPosition; } } else { int rating = PlayerDataManager.GetRating(PlayerDataManager.SelectedGameMode); RankStats prevRankStats = Variables.instance.GetPrevRankStats(rating); RankStats rankStats = Variables.instance.GetRankStats(rating); RankStats nextRankStats = Variables.instance.GetNextRankStats(rating); float num4 = (float)(rating - prevRankStats.maxTrophies) / (float)(rankStats.maxTrophies - prevRankStats.maxTrophies); promotionXpBarFill.fillAmount = num4; Vector2 anchoredPosition2 = promotionXpIndicator.rectTransform.anchoredPosition; anchoredPosition2.x = promotionXpBarFill.rectTransform.rect.width * num4; promotionXpIndicator.rectTransform.anchoredPosition = anchoredPosition2; promotionRankText.text = ScriptLocalization.Get(rankStats.name); newRank.sprite = ((PlayerDataManager.SelectedGameMode == GameMode.Arena2v2) ? rankStats.sprite2v2 : rankStats.sprite); newRank.SetNativeSize(); promotionPrevRank.sprite = rankStats.smallSprite; promotionPrevRank.SetNativeSize(); promotionNextRank.sprite = nextRankStats.smallSprite; promotionNextRank.SetNativeSize(); } StartCoroutine(PromotionAnimation()); MenuController.instance.StartCoroutine(AudioManager.FadeMusicForSound("promotion")); }
public static RankStats CalculateRankDelta(this RankStats a, RankStats b) { return(new RankStats { SeasonId = b.SeasonId, Rank = b.Rank, Abandons = b.Abandons - a.Abandons, Losses = b.Losses - a.Losses, Mmr = Math.Max(b.Mmr, a.Mmr), Wins = b.Wins - a.Wins, MaxMmr = Math.Max(b.MaxMmr, a.MaxMmr), MaxRank = Math.Max(a.MaxRank, b.MaxRank) }); }
static void DumpPlayerGroupStats( TextWriter writer, IList<PlayerInfo> infos, string groupName ) { RankStats stat = new RankStats(); foreach( Rank rank2 in RankManager.Ranks ) { stat.PreviousRank.Add( rank2, 0 ); } int totalCount = infos.Count; int bannedCount = infos.Count( info => info.IsBanned ); int inactiveCount = infos.Count( info => info.TimeSinceLastSeen.TotalDays >= 30 ); infos = infos.Where( info => (info.TimeSinceLastSeen.TotalDays < 30 && !info.IsBanned) ).ToList(); if( infos.Count == 0 ) { writer.WriteLine( "{0}: {1} players, {2} banned, {3} inactive", groupName, totalCount, bannedCount, inactiveCount ); writer.WriteLine(); return; } for( int i = 0; i < infos.Count; i++ ) { stat.TimeSinceFirstLogin += infos[i].TimeSinceFirstLogin; stat.TimeSinceLastLogin += infos[i].TimeSinceLastLogin; stat.TotalTime += infos[i].TotalTime; stat.BlocksBuilt += infos[i].BlocksBuilt; stat.BlocksDeleted += infos[i].BlocksDeleted; stat.BlocksDrawn += infos[i].BlocksDrawn; stat.TimesVisited += infos[i].TimesVisited; stat.MessagesWritten += infos[i].MessagesWritten; stat.TimesKicked += infos[i].TimesKicked; stat.TimesKickedOthers += infos[i].TimesKickedOthers; stat.TimesBannedOthers += infos[i].TimesBannedOthers; if( infos[i].PreviousRank != null ) stat.PreviousRank[infos[i].PreviousRank]++; } stat.BlockRatio = stat.BlocksBuilt / (double)Math.Max( stat.BlocksDeleted, 1 ); stat.BlocksChanged = stat.BlocksDeleted + stat.BlocksBuilt; stat.TimeSinceFirstLoginMedian = DateTime.UtcNow.Subtract( infos.OrderByDescending( info => info.FirstLoginDate ) .ElementAt( infos.Count / 2 ).FirstLoginDate ); stat.TimeSinceLastLoginMedian = DateTime.UtcNow.Subtract( infos.OrderByDescending( info => info.LastLoginDate ) .ElementAt( infos.Count / 2 ).LastLoginDate ); stat.TotalTimeMedian = infos.OrderByDescending( info => info.TotalTime ).ElementAt( infos.Count / 2 ).TotalTime; stat.BlocksBuiltMedian = infos.OrderByDescending( info => info.BlocksBuilt ).ElementAt( infos.Count / 2 ).BlocksBuilt; stat.BlocksDeletedMedian = infos.OrderByDescending( info => info.BlocksDeleted ).ElementAt( infos.Count / 2 ).BlocksDeleted; stat.BlocksDrawnMedian = infos.OrderByDescending( info => info.BlocksDrawn ).ElementAt( infos.Count / 2 ).BlocksDrawn; PlayerInfo medianBlocksChangedPlayerInfo = infos.OrderByDescending( info => (info.BlocksDeleted + info.BlocksBuilt) ).ElementAt( infos.Count / 2 ); stat.BlocksChangedMedian = medianBlocksChangedPlayerInfo.BlocksDeleted + medianBlocksChangedPlayerInfo.BlocksBuilt; PlayerInfo medianBlockRatioPlayerInfo = infos.OrderByDescending( info => (info.BlocksBuilt / (double)Math.Max( info.BlocksDeleted, 1 )) ) .ElementAt( infos.Count / 2 ); stat.BlockRatioMedian = medianBlockRatioPlayerInfo.BlocksBuilt / (double)Math.Max( medianBlockRatioPlayerInfo.BlocksDeleted, 1 ); stat.TimesVisitedMedian = infos.OrderByDescending( info => info.TimesVisited ).ElementAt( infos.Count / 2 ).TimesVisited; stat.MessagesWrittenMedian = infos.OrderByDescending( info => info.MessagesWritten ).ElementAt( infos.Count / 2 ).MessagesWritten; stat.TimesKickedMedian = infos.OrderByDescending( info => info.TimesKicked ).ElementAt( infos.Count / 2 ).TimesKicked; stat.TimesKickedOthersMedian = infos.OrderByDescending( info => info.TimesKickedOthers ).ElementAt( infos.Count / 2 ).TimesKickedOthers; stat.TimesBannedOthersMedian = infos.OrderByDescending( info => info.TimesBannedOthers ).ElementAt( infos.Count / 2 ).TimesBannedOthers; stat.TopTimeSinceFirstLogin = infos.OrderBy( info => info.FirstLoginDate ).ToArray(); stat.TopTimeSinceLastLogin = infos.OrderBy( info => info.LastLoginDate ).ToArray(); stat.TopTotalTime = infos.OrderByDescending( info => info.TotalTime ).ToArray(); stat.TopBlocksBuilt = infos.OrderByDescending( info => info.BlocksBuilt ).ToArray(); stat.TopBlocksDeleted = infos.OrderByDescending( info => info.BlocksDeleted ).ToArray(); stat.TopBlocksDrawn = infos.OrderByDescending( info => info.BlocksDrawn ).ToArray(); stat.TopBlocksChanged = infos.OrderByDescending( info => (info.BlocksDeleted + info.BlocksBuilt) ).ToArray(); stat.TopBlockRatio = infos.OrderByDescending( info => (info.BlocksBuilt / (double)Math.Max( info.BlocksDeleted, 1 )) ).ToArray(); stat.TopTimesVisited = infos.OrderByDescending( info => info.TimesVisited ).ToArray(); stat.TopMessagesWritten = infos.OrderByDescending( info => info.MessagesWritten ).ToArray(); stat.TopTimesKicked = infos.OrderByDescending( info => info.TimesKicked ).ToArray(); stat.TopTimesKickedOthers = infos.OrderByDescending( info => info.TimesKickedOthers ).ToArray(); stat.TopTimesBannedOthers = infos.OrderByDescending( info => info.TimesBannedOthers ).ToArray(); writer.WriteLine( "{0}: {1} players, {2} banned, {3} inactive", groupName, totalCount, bannedCount, inactiveCount ); writer.WriteLine( " TimeSinceFirstLogin: {0} mean, {1} median, {2} total", TimeSpan.FromTicks( stat.TimeSinceFirstLogin.Ticks / infos.Count ).ToCompactString(), stat.TimeSinceFirstLoginMedian.ToCompactString(), stat.TimeSinceFirstLogin.ToCompactString() ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopTimeSinceFirstLogin.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.TimeSinceFirstLogin.ToCompactString(), info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopTimeSinceFirstLogin.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.TimeSinceFirstLogin.ToCompactString(), info.Name ); } } else { foreach( PlayerInfo info in stat.TopTimeSinceFirstLogin ) { writer.WriteLine( " {0,20} {1}", info.TimeSinceFirstLogin.ToCompactString(), info.Name ); } } writer.WriteLine(); writer.WriteLine( " TimeSinceLastLogin: {0} mean, {1} median, {2} total", TimeSpan.FromTicks( stat.TimeSinceLastLogin.Ticks / infos.Count ).ToCompactString(), stat.TimeSinceLastLoginMedian.ToCompactString(), stat.TimeSinceLastLogin.ToCompactString() ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopTimeSinceLastLogin.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.TimeSinceLastLogin.ToCompactString(), info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopTimeSinceLastLogin.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.TimeSinceLastLogin.ToCompactString(), info.Name ); } } else { foreach( PlayerInfo info in stat.TopTimeSinceLastLogin ) { writer.WriteLine( " {0,20} {1}", info.TimeSinceLastLogin.ToCompactString(), info.Name ); } } writer.WriteLine(); writer.WriteLine( " TotalTime: {0} mean, {1} median, {2} total", TimeSpan.FromTicks( stat.TotalTime.Ticks / infos.Count ).ToCompactString(), stat.TotalTimeMedian.ToCompactString(), stat.TotalTime.ToCompactString() ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopTotalTime.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.TotalTime.ToCompactString(), info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopTotalTime.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.TotalTime.ToCompactString(), info.Name ); } } else { foreach( PlayerInfo info in stat.TopTotalTime ) { writer.WriteLine( " {0,20} {1}", info.TotalTime.ToCompactString(), info.Name ); } } writer.WriteLine(); writer.WriteLine( " BlocksBuilt: {0} mean, {1} median, {2} total", stat.BlocksBuilt / infos.Count, stat.BlocksBuiltMedian, stat.BlocksBuilt ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopBlocksBuilt.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.BlocksBuilt, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopBlocksBuilt.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.BlocksBuilt, info.Name ); } } else { foreach( PlayerInfo info in stat.TopBlocksBuilt ) { writer.WriteLine( " {0,20} {1}", info.BlocksBuilt, info.Name ); } } writer.WriteLine(); writer.WriteLine( " BlocksDeleted: {0} mean, {1} median, {2} total", stat.BlocksDeleted / infos.Count, stat.BlocksDeletedMedian, stat.BlocksDeleted ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopBlocksDeleted.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.BlocksDeleted, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopBlocksDeleted.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.BlocksDeleted, info.Name ); } } else { foreach( PlayerInfo info in stat.TopBlocksDeleted ) { writer.WriteLine( " {0,20} {1}", info.BlocksDeleted, info.Name ); } } writer.WriteLine(); writer.WriteLine( " BlocksChanged: {0} mean, {1} median, {2} total", stat.BlocksChanged / infos.Count, stat.BlocksChangedMedian, stat.BlocksChanged ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopBlocksChanged.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", (info.BlocksDeleted + info.BlocksBuilt), info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopBlocksChanged.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", (info.BlocksDeleted + info.BlocksBuilt), info.Name ); } } else { foreach( PlayerInfo info in stat.TopBlocksChanged ) { writer.WriteLine( " {0,20} {1}", (info.BlocksDeleted + info.BlocksBuilt), info.Name ); } } writer.WriteLine(); writer.WriteLine( " BlocksDrawn: {0} mean, {1} median, {2} total", stat.BlocksDrawn / infos.Count, stat.BlocksDrawnMedian, stat.BlocksDrawn ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopBlocksDrawn.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.BlocksDrawn, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopBlocksDrawn.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.BlocksDrawn, info.Name ); } } else { foreach( PlayerInfo info in stat.TopBlocksDrawn ) { writer.WriteLine( " {0,20} {1}", info.BlocksDrawn, info.Name ); } } writer.WriteLine( " BlockRatio: {0:0.000} mean, {1:0.000} median", stat.BlockRatio, stat.BlockRatioMedian ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopBlockRatio.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20:0.000} {1}", (info.BlocksBuilt / (double)Math.Max( info.BlocksDeleted, 1 )), info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopBlockRatio.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20:0.000} {1}", (info.BlocksBuilt / (double)Math.Max( info.BlocksDeleted, 1 )), info.Name ); } } else { foreach( PlayerInfo info in stat.TopBlockRatio ) { writer.WriteLine( " {0,20:0.000} {1}", (info.BlocksBuilt / (double)Math.Max( info.BlocksDeleted, 1 )), info.Name ); } } writer.WriteLine(); writer.WriteLine( " TimesVisited: {0} mean, {1} median, {2} total", stat.TimesVisited / infos.Count, stat.TimesVisitedMedian, stat.TimesVisited ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopTimesVisited.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.TimesVisited, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopTimesVisited.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.TimesVisited, info.Name ); } } else { foreach( PlayerInfo info in stat.TopTimesVisited ) { writer.WriteLine( " {0,20} {1}", info.TimesVisited, info.Name ); } } writer.WriteLine(); writer.WriteLine( " MessagesWritten: {0} mean, {1} median, {2} total", stat.MessagesWritten / infos.Count, stat.MessagesWrittenMedian, stat.MessagesWritten ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopMessagesWritten.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.MessagesWritten, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopMessagesWritten.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.MessagesWritten, info.Name ); } } else { foreach( PlayerInfo info in stat.TopMessagesWritten ) { writer.WriteLine( " {0,20} {1}", info.MessagesWritten, info.Name ); } } writer.WriteLine(); writer.WriteLine( " TimesKicked: {0:0.0} mean, {1} median, {2} total", stat.TimesKicked / (double)infos.Count, stat.TimesKickedMedian, stat.TimesKicked ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopTimesKicked.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.TimesKicked, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopTimesKicked.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.TimesKicked, info.Name ); } } else { foreach( PlayerInfo info in stat.TopTimesKicked ) { writer.WriteLine( " {0,20} {1}", info.TimesKicked, info.Name ); } } writer.WriteLine(); writer.WriteLine( " TimesKickedOthers: {0:0.0} mean, {1} median, {2} total", stat.TimesKickedOthers / (double)infos.Count, stat.TimesKickedOthersMedian, stat.TimesKickedOthers ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopTimesKickedOthers.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.TimesKickedOthers, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopTimesKickedOthers.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.TimesKickedOthers, info.Name ); } } else { foreach( PlayerInfo info in stat.TopTimesKickedOthers ) { writer.WriteLine( " {0,20} {1}", info.TimesKickedOthers, info.Name ); } } writer.WriteLine(); writer.WriteLine( " TimesBannedOthers: {0:0.0} mean, {1} median, {2} total", stat.TimesBannedOthers / (double)infos.Count, stat.TimesBannedOthersMedian, stat.TimesBannedOthers ); if( infos.Count() > TopPlayersToList * 2 + 1 ) { foreach( PlayerInfo info in stat.TopTimesBannedOthers.Take( TopPlayersToList ) ) { writer.WriteLine( " {0,20} {1}", info.TimesBannedOthers, info.Name ); } writer.WriteLine( " ...." ); foreach( PlayerInfo info in stat.TopTimesBannedOthers.Reverse().Take( TopPlayersToList ).Reverse() ) { writer.WriteLine( " {0,20} {1}", info.TimesBannedOthers, info.Name ); } } else { foreach( PlayerInfo info in stat.TopTimesBannedOthers ) { writer.WriteLine( " {0,20} {1}", info.TimesBannedOthers, info.Name ); } } writer.WriteLine(); }
private IEnumerator RatingScroll(int ratingBefore, int difference, int winStreakCount = 0, int winStreakBonus = 0, bool showWinStreak = true) { arenaWinResult.container.SetActive(value: false); arena2v2WinResult.container.SetActive(value: false); arenaOtherResult.container.SetActive(value: false); arena2v2OtherResult.container.SetActive(value: false); ArenaResultScreen result = (PlayerDataManager.SelectedGameMode != GameMode.Arena) ? ((difference > 0) ? arena2v2WinResult : arena2v2OtherResult) : ((difference > 0) ? arenaWinResult : arenaOtherResult); if (!showWinStreak) { result = ((PlayerDataManager.SelectedGameMode == GameMode.Arena) ? arenaOtherResult : arena2v2OtherResult); } result.container.SetActive(value: true); result.ratingText.text = ratingBefore.ToString(); result.ratingChangeText.gameObject.SetActive(value: true); result.winStreakCountText.gameObject.SetActive(showWinStreak); if (difference < 0) { result.ratingChangeText.text = difference.ToString(); } else if (difference > 0) { if (showWinStreak) { result.winStreakCountText.GetComponent <LocalizationParamsManager>().SetParameterValue("AMOUNT", winStreakCount.ToString()); result.winStreakBonusText.text = $"+{winStreakBonus}"; } result.ratingChangeText.text = $"+{difference - winStreakBonus}"; } else { result.ratingChangeText.gameObject.SetActive(value: false); } RankStats prevRankStats = Variables.instance.GetPrevRankStats(ratingBefore); RankStats rankStats = Variables.instance.GetRankStats(ratingBefore); RankStats nextRankStats = Variables.instance.GetNextRankStats(ratingBefore); RankStats rankStats2 = Variables.instance.GetRankStats(ratingBefore + difference); bool flag = rankStats.maxTrophies == Variables.instance.rankStats[Variables.instance.rankStats.Length - 1].maxTrophies; didArenaLevelUp = false; if (rankStats2.maxTrophies > rankStats.maxTrophies) { didArenaLevelUp = true; } result.prevRank.sprite = rankStats.smallSprite; result.prevRank.SetNativeSize(); if (nextRankStats.sprite != null) { result.nextRank.gameObject.SetActive(value: true); result.nextRank.sprite = nextRankStats.smallSprite; result.nextRank.SetNativeSize(); } else { result.nextRank.gameObject.SetActive(value: false); } result.barFill.fillAmount = (float)(ratingBefore - prevRankStats.maxTrophies) / (float)(rankStats.maxTrophies - prevRankStats.maxTrophies); Vector2 anchoredPosition = result.barFillIndicator.rectTransform.anchoredPosition; anchoredPosition.x = result.barFill.rectTransform.rect.width * result.barFill.fillAmount; result.barFillIndicator.rectTransform.anchoredPosition = anchoredPosition; result.barContainer.SetActive(!flag); yield return(new WaitForSecondsRealtime(1f)); int num2; for (int i = 1; i <= Mathf.Abs(difference); i = num2) { int num = ratingBefore + i * (int)Mathf.Sign(difference); prevRankStats = Variables.instance.GetPrevRankStats(num); rankStats = Variables.instance.GetRankStats(num); nextRankStats = Variables.instance.GetNextRankStats(num); result.prevRank.sprite = rankStats.smallSprite; result.prevRank.SetNativeSize(); if (nextRankStats.sprite != null) { result.nextRank.gameObject.SetActive(value: true); result.nextRank.sprite = nextRankStats.smallSprite; result.nextRank.SetNativeSize(); } else { result.nextRank.gameObject.SetActive(value: false); } result.ratingText.text = num.ToString(); flag = (rankStats.maxTrophies == Variables.instance.rankStats[Variables.instance.rankStats.Length - 1].maxTrophies); result.barContainer.SetActive(!flag); result.barFill.fillAmount = (float)(num - prevRankStats.maxTrophies) / (float)(rankStats.maxTrophies - prevRankStats.maxTrophies); anchoredPosition = result.barFillIndicator.rectTransform.anchoredPosition; anchoredPosition.x = result.barFill.rectTransform.rect.width * result.barFill.fillAmount; result.barFillIndicator.rectTransform.anchoredPosition = anchoredPosition; yield return(new WaitForSecondsRealtime(0.1f)); num2 = i + 1; } }