예제 #1
0
    private void UpdatePlayerStats()
    {
        for (int i = 0; i < 3; i++)
        {
            int num = 0;
            if (i != 0)
            {
                if (i != 1)
                {
                    if (i == 2)
                    {
                        num = GameProgress.GetInt("cake_race_bronze_trophies_won", 0, GameProgress.Location.Local, null);
                    }
                }
                else
                {
                    num = GameProgress.GetInt("cake_race_silver_trophies_won", 0, GameProgress.Location.Local, null);
                }
            }
            else
            {
                num = GameProgress.GetInt("cake_race_gold_trophies_won", 0, GameProgress.Location.Local, null);
            }
            this.trophyIcons[i].gameObject.SetActive(num > 0);
            TextMeshHelper.UpdateTextMeshes(this.trophyAmountLabels[i], (num <= 0) ? string.Empty : num.ToString(), false);
        }
        int @int = GameProgress.GetInt("cake_race_coins_won", 0, GameProgress.Location.Local, null);

        TextMeshHelper.UpdateTextMeshes(this.totalCoinsWonLabel, string.Format("[snout] {0}", @int), false);
        TextMeshSpriteIcons.EnsureSpriteIcon(this.totalCoinsWonLabel);
        int int2 = GameProgress.GetInt("cake_race_highest_rank", 0, GameProgress.Location.Local, null);

        TextMeshHelper.UpdateTextMeshes(this.highestRankLabel, (int2 <= 0) ? "-" : int2.ToString(), false);
    }
예제 #2
0
 private void Update()
 {
     if (!Singleton <PlayerProgress> .IsInstantiated())
     {
         return;
     }
     if (this.currentExperience == Singleton <PlayerProgress> .Instance.ExperienceToNextLevel && Singleton <PlayerProgress> .Instance.LevelUpPending && this.currentState == PlayerProgressBar.State.Regular)
     {
         this.SetState((!ResourceBar.Instance.IsItemEnabled(ResourceBar.Item.PlayerProgress) || !this.canLevelUp) ? PlayerProgressBar.State.WaitingLevelInactive : PlayerProgressBar.State.WaitingLevelActive);
     }
     if (this.currentExperience != this.targetExperience && Time.realtimeSinceStartup >= this.nextUpdate && this.resourceBarItem.IsShowing && this.currentState == PlayerProgressBar.State.Regular)
     {
         this.nextUpdate = Time.realtimeSinceStartup + SoftCurrencyButton.updateInterval;
         int deltaAmount = SoftCurrencyButton.GetDeltaAmount(this.currentExperience, this.targetExperience);
         if (this.currentExperience < this.targetExperience)
         {
             this.currentExperience += deltaAmount;
         }
         else if (this.currentExperience > this.targetExperience)
         {
             this.currentExperience -= deltaAmount;
         }
         int experienceToNextLevel = Singleton <PlayerProgress> .Instance.ExperienceToNextLevel;
         int level = Singleton <PlayerProgress> .Instance.Level;
         this.currentExperience = Mathf.Min(this.currentExperience, experienceToNextLevel);
         TextMeshHelper.UpdateTextMeshes(this.levelLabel, level.ToString(), false);
         TextMeshHelper.UpdateTextMeshes(this.experienceLabel, string.Format("{0}/{1}", this.currentExperience, experienceToNextLevel), false);
         float d = Mathf.Clamp((float)this.currentExperience / (float)experienceToNextLevel, 0.001f, 1f);
         this.experienceFillMeter.localScale = Vector3.forward + Vector3.up + Vector3.right * d * this.maxFill;
     }
 }
예제 #3
0
 public void UpdateAmount(bool force = false)
 {
     if (!Singleton <PlayerProgress> .IsInstantiated())
     {
         return;
     }
     this.nextUpdate       = Time.realtimeSinceStartup;
     this.targetExperience = this.currentRealExperience;
     if (force && this.currentState == PlayerProgressBar.State.Regular)
     {
         int experienceToNextLevel = Singleton <PlayerProgress> .Instance.ExperienceToNextLevel;
         this.currentRealExperience = Singleton <PlayerProgress> .Instance.Experience;
         this.targetExperience      = this.currentRealExperience;
         this.currentExperience     = this.targetExperience;
         TextMeshHelper.UpdateTextMeshes(this.levelLabel, Singleton <PlayerProgress> .Instance.Level.ToString(), false);
         if (Singleton <PlayerProgress> .Instance.LevelUpPending)
         {
             this.experienceFillMeter.localScale = Vector3.forward + Vector3.up + Vector3.right * this.maxFill;
             if (ResourceBar.Instance.IsItemEnabled(ResourceBar.Item.PlayerProgress) && this.canLevelUp)
             {
                 this.SetState(PlayerProgressBar.State.WaitingLevelActive);
             }
             else
             {
                 this.SetState(PlayerProgressBar.State.WaitingLevelInactive);
             }
         }
         else
         {
             TextMeshHelper.UpdateTextMeshes(this.experienceLabel, string.Format("{0}/{1}", this.targetExperience, experienceToNextLevel), false);
             float d = Mathf.Clamp((float)this.currentExperience / (float)experienceToNextLevel, 0.001f, 1f);
             this.experienceFillMeter.localScale = Vector3.forward + Vector3.up + Vector3.right * d * this.maxFill;
         }
     }
 }
예제 #4
0
    private void UpdateDaysLeft()
    {
        string arg = string.Format("{0}", this.SeasonDaysLeft());

        Localizer.LocaleParameters localeParameters = Singleton <Localizer> .Instance.Resolve(this.daysLeftKey, null);

        TextMeshHelper.UpdateTextMeshes(this.daysLeftTextMesh, string.Format(localeParameters.translation, arg), false);
    }
예제 #5
0
 public void SetRewards(LootCrateType crateType, int snoutCoins)
 {
     TextMeshHelper.UpdateTextMeshes(this.coinRewardLabel, snoutCoins.ToString(), false);
     for (int i = 0; i < this.rewardCrateContainer.childCount; i++)
     {
         Transform child = this.rewardCrateContainer.GetChild(i);
         child.gameObject.SetActive(child.name.Equals(crateType.ToString()));
     }
 }
예제 #6
0
 public void SetPlayerInfo(string name, int level, bool refreshTranslation = false)
 {
     if (string.IsNullOrEmpty(name))
     {
         name = "anonpig";
     }
     TextMeshHelper.UpdateTextMeshes(this.nameLabel, name, refreshTranslation);
     TextMeshHelper.UpdateTextMeshes(this.levelLabel, Mathf.Clamp(level, 0, 999).ToString(), refreshTranslation);
 }
예제 #7
0
 public void SetInfo(int track, int score, int cakeCount, bool kingsFavorite)
 {
     TextMeshHelper.UpdateTextMeshes(this.trackLabel, string.Format("{0}", track + 1), false);
     TextMeshHelper.UpdateTextMeshes(this.scoreLabel, (score > 0) ? string.Format("{0:n0}", score) : "-", false);
     this.kingsFavoriteIcon.enabled = kingsFavorite;
     for (int i = 0; i < this.cakes.Length; i++)
     {
         this.cakes[i].enabled = (i < cakeCount);
     }
 }
예제 #8
0
 private void SetNameLabels(string left, string right, bool refreshLocalization)
 {
     if (this.leftName != null)
     {
         TextMeshHelper.UpdateTextMeshes(this.leftName, left, refreshLocalization);
     }
     if (this.rightName != null)
     {
         TextMeshHelper.UpdateTextMeshes(this.rightName, right, false);
     }
 }
예제 #9
0
 private void SetScoreLabels(int score, int opponentScore)
 {
     if (this.leftScore != null)
     {
         TextMeshHelper.UpdateTextMeshes(this.leftScore, (score >= 0) ? string.Format("{0:n0}", score) : string.Empty, false);
     }
     if (this.rightScore != null)
     {
         TextMeshHelper.UpdateTextMeshes(this.rightScore, (opponentScore >= 0) ? string.Format("{0:n0}", opponentScore) : string.Empty, false);
     }
 }
예제 #10
0
    private void Awake()
    {
        this.SetStatus(ExtraCoinsRewardButton.Status.Uninitialized);
        if (this.labels != null && this.labels.Length > 0)
        {
            this.rewardAmount = Singleton <GameConfigurationManager> .Instance.GetValue <int>("extra_coins_video", "coin_reward");

            string text = string.Format(this.stringFormat, this.rewardAmount);
            TextMeshHelper.UpdateTextMeshes(this.labels, text, false);
        }
        this.Initialize();
    }
예제 #11
0
 private void SetLockScreen(bool locked, string localeKey, bool loading)
 {
     if (this.lockScreen != null)
     {
         this.lockScreen.SetActive(locked);
         TextMesh[] componentsInChildren = this.lockScreen.GetComponentsInChildren <TextMesh>();
         TextMeshHelper.UpdateTextMeshes(componentsInChildren, localeKey, !string.IsNullOrEmpty(localeKey));
     }
     if (this.lockScreenLoading != null)
     {
         this.lockScreenLoading.SetActive(loading);
     }
 }
예제 #12
0
    public void SetInfo(string playFabId, string name, int score, int rank)
    {
        this.playFabId   = playFabId;
        this.playerName  = name;
        this.playerScore = score;
        this.playerRank  = rank;
        if (string.IsNullOrEmpty(playFabId))
        {
            this.Show(false);
            return;
        }
        this.Show(true);
        bool   flag   = playFabId.Equals(HatchManager.CurrentPlayer.PlayFabID);
        string format = (!flag) ? "{0}" : string.Format("{0} ({1})", this.GetLocalizedPlayerName(), "{0}");

        string[] array = name.Split(new char[]
        {
            '|'
        });
        if (array != null && array.Length > 0)
        {
            this.playerName = string.Format(format, array[0]);
        }
        else
        {
            this.playerName = string.Format(format, name);
        }
        TextMeshHelper.UpdateTextMeshes(this.nameLabel, this.playerName, false);
        TextMeshHelper.UpdateTextMeshes(this.scoreLabel, string.Format("{0:n0}", score), false);
        if (rank >= 0)
        {
            this.SetRank(rank + 1);
        }
        else
        {
            this.SetRank(rank);
        }
        if (this.otherPlayerBackground != null)
        {
            this.otherPlayerBackground.enabled = !flag;
        }
        if (this.currentPlayerBackground != null)
        {
            this.currentPlayerBackground.enabled = flag;
        }
        if (this.currentPlayerInfoButton != null)
        {
            this.currentPlayerInfoButton.enabled = flag;
        }
    }
예제 #13
0
 public void UpdateAmount(bool forceUpdate = false)
 {
     if (this.labels == null || !GameProgress.Initialized)
     {
         return;
     }
     this.targetAmount = this.GetCurrencyCount();
     this.nextUpdate   = Time.realtimeSinceStartup;
     if (forceUpdate)
     {
         this.currentAmount = this.targetAmount;
         TextMeshHelper.UpdateTextMeshes(this.labels, string.Format("{0}", this.currentAmount), false);
     }
 }
예제 #14
0
    private void ChangeState(State newState)
    {
        this.state = newState;
        if (this.state == LootCrateSlot.State.Empty)
        {
            this.crateType = LootCrateType.None;
        }
        this.activeTf.gameObject.SetActive(this.state != LootCrateSlot.State.Empty);
        this.emptyTf.gameObject.SetActive(this.state == LootCrateSlot.State.Empty);
        this.unlockedTf.gameObject.SetActive(this.state == LootCrateSlot.State.Unlocked);
        this.priceTf.gameObject.SetActive(this.state == LootCrateSlot.State.Locked);
        this.timeTf.gameObject.SetActive(this.state != LootCrateSlot.State.Unlocked);
        this.lockIcon.enabled  = (this.state == LootCrateSlot.State.Inactive);
        this.clockIcon.enabled = (this.state == LootCrateSlot.State.Locked);
        bool flag = this.state == LootCrateSlot.State.Unlocked || this.state == LootCrateSlot.State.Inactive;

        this.crateHolder.transform.localScale    = Vector3.one * ((!flag) ? 1f : 1.2f);
        this.crateHolder.transform.localPosition = Vector3.up * ((!flag) ? 0.1f : 0f);
        if (this.crateType != LootCrateType.None && this.crateHolder.childCount == 0 && this.state != LootCrateSlot.State.Empty)
        {
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(LootCrateSlots.GetCratePrefab(this.crateType));
            gameObject.transform.parent        = this.crateHolder;
            gameObject.transform.localPosition = Vector3.zero;
            gameObject.transform.localScale    = Vector3.one;
            gameObject.transform.localRotation = Quaternion.identity;
        }
        else if (this.crateHolder.childCount > 0 && this.state == LootCrateSlot.State.Empty)
        {
            for (int i = 0; i < this.crateHolder.childCount; i++)
            {
                Transform child = this.crateHolder.GetChild(i);
                if (child)
                {
                    UnityEngine.Object.Destroy(child.gameObject);
                }
            }
        }
        if (this.state == LootCrateSlot.State.Locked)
        {
            Localizer.LocaleParameters localeParameters = Singleton <Localizer> .Instance.Resolve(this.openNowLocalization, null);

            TextMeshHelper.UpdateTextMeshes(this.activeInfoLabel, localeParameters.translation, false);
            TextMeshHelper.Wrap(this.activeInfoLabel, (!TextMeshHelper.UsesKanjiCharacters()) ? 8 : 4);
        }
        else
        {
            TextMeshHelper.UpdateTextMeshes(this.activeInfoLabel, string.Empty, false);
        }
        this.UpdateLabels();
    }
예제 #15
0
 public void SetRewards(LootCrateType crateType, int coinAmount)
 {
     for (int i = 0; i < this.crateIcons.Length; i++)
     {
         if (this.crateIcons[i] != null)
         {
             this.crateIcons[i].SetActive(crateType != LootCrateType.None && i == Mathf.Clamp((int)crateType, 0, 6));
         }
     }
     if (this.coinPrizeContainer != null)
     {
         TextMeshHelper.UpdateTextMeshes(this.coinPrizeLabel, coinAmount.ToString(), false);
         this.coinPrizeContainer.gameObject.SetActive(coinAmount > 0);
     }
 }
예제 #16
0
    private void SetWinCount(int wins)
    {
        CakeRaceMenu.WinCount = wins;
        if (CakeRaceMenu.IsTutorial)
        {
            Localizer.LocaleParameters localeParameters = Singleton <Localizer> .Instance.Resolve(this.winsLabelKey, null);

            TextMeshHelper.UpdateTextMeshes(this.winsLabel, string.Format(localeParameters.translation, CakeRaceMenu.WinCount), false);
            TextMeshHelper.Wrap(this.winsLabel, (!TextMeshHelper.UsesKanjiCharacters()) ? 1 : 6);
        }
        else
        {
            TextMeshHelper.UpdateTextMeshes(this.winsLabel, string.Empty, false);
        }
    }
예제 #17
0
    public void SetLevelRequirement(int levelRequirement)
    {
        Localizer.LocaleParameters localeParameters = Singleton <Localizer> .Instance.Resolve(this.descriptionKey, null);

        if (localeParameters.translation.Contains("{0}"))
        {
            TextMeshHelper.UpdateTextMeshes(this.descriptionLabel, string.Format(localeParameters.translation, levelRequirement), false);
        }
        else
        {
            TextMeshHelper.UpdateTextMeshes(this.descriptionLabel, localeParameters.translation, false);
        }
        TextMeshHelper.Wrap(this.descriptionLabel, (!TextMeshHelper.UsesKanjiCharacters()) ? 16 : 8);
        TextMeshHelper.UpdateTextMeshes(this.levelRequirementLabel, levelRequirement.ToString(), false);
    }
예제 #18
0
    private void UpdateLabels()
    {
        string formattedTimeFromSeconds = LootCrateSlot.GetFormattedTimeFromSeconds((int)this.TimeLeftInSeconds());

        this.nextLabelUpdateTime = Time.realtimeSinceStartup + 1f;
        TextMeshHelper.UpdateTextMeshes(this.timeLabel, formattedTimeFromSeconds, false);
        TextMeshHelper.UpdateTextMeshes(this.priceLabel, string.Format("{0} [snout]", LootCrateSlot.GetSnoutCoinPrice(this.crateType, this.TimeLeftInSeconds())), false);
        TextMeshSpriteIcons[] componentsInChildren = this.priceTf.GetComponentsInChildren <TextMeshSpriteIcons>();
        if (componentsInChildren != null)
        {
            for (int i = 0; i < componentsInChildren.Length; i++)
            {
                componentsInChildren[i].UpdateIcons();
            }
        }
    }
예제 #19
0
 public void SetRankScoreInfo(int rank, int score, bool isLocalPlayer = false)
 {
     this.Init();
     this.trophies.gameObject.SetActive(isLocalPlayer);
     this.scroller.SetLowerPadding((!isLocalPlayer) ? -5.5f : 2f);
     TextMeshHelper.UpdateTextMeshes(this.rankLabel, (rank > 0) ? rank.ToString() : "-", false);
     TextMeshHelper.UpdateTextMeshes(this.scoreLabel, (score > 0) ? string.Format("{0:n0}", score) : "-", false);
     for (int i = 0; i < this.rankBackgrounds.Length; i++)
     {
         if (this.rankBackgrounds[i] != null)
         {
             this.rankBackgrounds[i].enabled = (i + 1 == rank || (i == 3 && (rank > 3 || rank == 0)));
         }
     }
     if (isLocalPlayer)
     {
         this.UpdatePlayerStats();
     }
 }
예제 #20
0
 private void Lock(bool doLock)
 {
     this.isLocked = doLock;
     if (this.lockedContainer)
     {
         this.lockedContainer.SetActive(doLock);
     }
     if (this.unlockedContainer)
     {
         this.unlockedContainer.SetActive(!doLock);
     }
     if (doLock)
     {
         TextMeshHelper.UpdateTextMeshes(this.levelLabel, this.levelRequirement.ToString(), false);
     }
     if (this.OnUnlock != null)
     {
         this.OnUnlock(!doLock);
     }
 }
예제 #21
0
    public void SetCrateRankAndReward(LootCrateType crateType, int rank, int reward)
    {
        this.reward = reward;
        Localizer.LocaleParameters localeParameters = Singleton <Localizer> .Instance.Resolve(this.rankLocalizationKey, null);

        TextMeshHelper.UpdateTextMeshes(this.rankLabel, string.Format(localeParameters.translation, rank), false);
        TextMeshHelper.Wrap(this.rankLabel, 15);
        Localizer.LocaleParameters localeParameters2 = Singleton <Localizer> .Instance.Resolve(this.snoutRewardLocalizationKey, null);

        TextMeshHelper.UpdateTextMeshes(this.rewardLabel, string.Format(localeParameters2.translation, reward), false);
        TextMeshSpriteIcons.EnsureSpriteIcon(this.rewardLabel);
        TextMeshHelper.Wrap(this.rewardLabel, 15);
        this.lootCrate.gameObject.SetActive(crateType != LootCrateType.None);
        this.barrelContainer.SetActive(crateType == LootCrateType.None);
        if (crateType != LootCrateType.None)
        {
            this.lootCrate.initialSkinName = crateType.ToString();
            this.lootCrate.Initialize(true);
            this.lootCrate.state.SetAnimation(0, "Idle", true);
            this.lootCrate.Update(Time.deltaTime);
        }
        this.SetLoading(false);
    }
예제 #22
0
    protected override void Awake()
    {
        base.Awake();
        Transform transform = this.dialogRoot.transform.Find("TitleRibbon/TitleLabel");

        if (transform != null)
        {
            this.titleLabel = transform.GetComponentsInChildren <TextMesh>();
        }
        transform = this.dialogRoot.transform.Find("RewardContainer/RankLabel");
        if (transform != null)
        {
            this.rankLabel = transform.GetComponentsInChildren <TextMesh>();
        }
        transform = this.dialogRoot.transform.Find("RewardContainer/RewardLabel");
        if (transform != null)
        {
            this.rewardLabel = transform.GetComponentsInChildren <TextMesh>();
        }
        Localizer.LocaleParameters localeParameters = Singleton <Localizer> .Instance.Resolve(this.titleLocalizationKey, null);

        TextMeshHelper.UpdateTextMeshes(this.titleLabel, string.Format(localeParameters.translation, CakeRaceMenu.CurrentCakeRaceWeek() - 1), false);
    }
예제 #23
0
    public void InitPopup(int price, int secondsLeft, GameObject cratePrefab, LootCrateType lootCrate)
    {
        this.currentCrateType = lootCrate;
        this.SnoutCoinPrice   = price;
        if (this.priceLabel)
        {
            TextMesh[] componentsInChildren = this.priceLabel.gameObject.GetComponentsInChildren <TextMesh>();
            for (int i = 0; i < componentsInChildren.Length; i++)
            {
                componentsInChildren[i].text = string.Format("[snout] {0}", this.SnoutCoinPrice);
                TextMeshSpriteIcons.EnsureSpriteIcon(componentsInChildren[i]);
            }
        }
        string formattedTimeFromSeconds = LootCrateSlot.GetFormattedTimeFromSeconds(secondsLeft);

        if (this.timerLabel)
        {
            TextMesh[] componentsInChildren2 = this.timerLabel.gameObject.GetComponentsInChildren <TextMesh>();
            TextMeshHelper.UpdateTextMeshes(componentsInChildren2, formattedTimeFromSeconds, false);
        }
        if (this.unlockNowControls != null)
        {
            Transform transform = this.unlockNowControls.transform.Find("StartUnlockButton/TimeLabel");
            if (transform != null)
            {
                TextMesh[] componentsInChildren3 = transform.gameObject.GetComponentsInChildren <TextMesh>();
                TextMeshHelper.UpdateTextMeshes(componentsInChildren3, formattedTimeFromSeconds, false);
            }
        }
        if (this.skeletonAnimation)
        {
            this.skeletonAnimation.initialSkinName = lootCrate.ToString();
            this.skeletonAnimation.Initialize(true);
            this.skeletonAnimation.state.AddAnimation(0, "Idle", true, 0f);
        }
        this.InitRewardItems(lootCrate);
    }
예제 #24
0
 private void SetLevelUpText()
 {
     TextMeshHelper.UpdateTextMeshes(this.experienceLabel, "LOOT_WHEEL_TITLE", true);
 }
예제 #25
0
    private void OnEnable()
    {
        TextMeshHelper.UpdateTextMeshes(this.daysLeftLabel, string.Empty, false);
        TextMeshHelper.UpdateTextMeshes(this.winsLabel, string.Empty, false);
        WPFMonoBehaviour.mainCamera.backgroundColor = this.skyColor;
        KeyListener.keyReleased += this.HandleKeyListenerkeyReleased;
        if (!CakeRaceMenu.CakeRaceDisabled)
        {
            this.SetLockScreen(true, string.Empty, true);
            Singleton <NetworkManager> .Instance.CheckAccess(delegate(bool online)
            {
                if (online && !HatchManager.HasLoginError)
                {
                    this.InitRaceMenu();
                }
                else
                {
                    this.SetLockScreen(true, this.offlineErrorKey, false);
                }
            });
        }
        else
        {
            this.SetLockScreen(true, this.cakeRaceDisabledErrorKey, false);
        }
        if (!GameProgress.GetBool("CakeRaceUnlockShown", false, GameProgress.Location.Local, null))
        {
            GameProgress.SetBool("CakeRaceUnlockShown", true, GameProgress.Location.Local);
        }
        this.InitSeasonTracks();
        bool active = false;

        if (this.infoLabel != null)
        {
            for (int i = 0; i < this.infoLabel.Length; i++)
            {
                if (this.infoLabel[i] != null)
                {
                    this.infoLabel[i].gameObject.SetActive(active);
                }
            }
        }
        if (this.leaderboardButton != null)
        {
            Transform transform = this.leaderboardButton.transform.Find("Lock");
            if (CakeRaceMenu.IsTutorial)
            {
                transform.gameObject.SetActive(true);
                this.leaderboardButton.GetComponent <Button>().MethodToCall.Reset();
                this.leaderboardButton.AddComponent <ButtonAnimation>().ActivateAnimationName = "ButtonShake";
            }
            else
            {
                transform.gameObject.SetActive(false);
            }
            bool      @bool      = GameProgress.GetBool("leaderboard_opened", false, GameProgress.Location.Local, null);
            Transform transform2 = this.leaderboardButton.transform.Find("NewContentTag");
            transform2.gameObject.SetActive(!CakeRaceMenu.IsTutorial && !@bool);
        }
        this.UpdateCupIcon();
    }
예제 #26
0
 private void SetTitle(string title)
 {
     TextMeshHelper.UpdateTextMeshes(this.titleLabel, title, false);
 }
예제 #27
0
 public void SetScoreLabel(string text)
 {
     TextMeshHelper.UpdateTextMeshes(this.scoreLabel, text, false);
 }
예제 #28
0
    private IEnumerator CakeRaceEndScreenSequence()
    {
        TextMeshHelper.UpdateTextMeshes(this.bannerLabel, string.Empty, false);
        this.SetScoreLabels(-1, -1);
        this.SetNameLabels(string.Empty, string.Empty, false);
        yield return(new WaitForSeconds(0.5f));

        bool winner = this.cakeRaceMode.LocalPlayerIsWinner;

        this.judgeAnimation.state.SetAnimation(0, this.judgeAnimationIntro, false);
        this.judgeAnimation.state.AddAnimation(0, this.judgeAnimationIdle, true, 0f);
        yield return(null);

        this.judgeRenderer.enabled = true;
        yield return(new WaitForSeconds(1f));

        this.scoreAnimation.state.SetAnimation(0, (!winner) ? this.scoreAnimationOpponentWins : this.scoreAnimationPlayerWins, false);
        this.scoreAnimation.state.Event += this.OnScoreAnimationEvent;
        yield return(null);

        this.scoreRenderer.enabled = true;
        yield return(new WaitForSeconds(1f));

        this.judgeAnimation.state.SetAnimation(0, (!winner) ? this.judgeAnimationOpponentWins : this.judgeAnimationPlayerWins, false);
        this.judgeAnimation.state.AddAnimation(0, (!winner) ? this.judgeAnimationOpponentWinsIdle : this.judgeAnimationPlayerWinsIdle, true, 0f);
        yield return(new WaitForSeconds(2f));

        this.SetScoreLabels(this.cakeRaceMode.CurrentScore, this.cakeRaceMode.OpponentScore);
        this.SetNameLabels("CAKE_RACE_YOU", CakeRaceMode.OpponentReplay.GetPlayerName(), true);
        WPFMonoBehaviour.levelManager.StopAmbient();
        Singleton <AudioManager> .Instance.SpawnLoopingEffect(WPFMonoBehaviour.gameData.commonAudioCollection.starLoops[(!winner) ? 0 : 1], base.transform);

        this.bannerAnimation.state.SetAnimation(0, (!winner) ? this.bannerAnimationOpponentWins : this.bannerAnimationPlayerWins, false);
        yield return(null);

        Localizer.LocaleParameters winLabelParams = Singleton <Localizer> .Instance.Resolve((!winner)?this.bannerLoseLocalizationKey : this.bannerWinLocalizationKey, null);

        TextMeshHelper.UpdateTextMeshes(this.bannerLabel, winLabelParams.translation, false);
        yield return(null);

        this.bannerRenderer.enabled = true;
        if (winner)
        {
            for (int i = 0; i < this.hornAnimations.Length; i++)
            {
                this.hornAnimations[i].gameObject.SetActive(true);
                this.hornAnimations[i].state.SetAnimation(0, this.hornAnimationPlayerWins, false);
            }
            this.pillowRenderer.enabled         = true;
            this.hornAnimations[0].state.Event += this.OnAnimationEvent;
            yield return(null);
        }
        this.nextOpponentButton.SetActive(!this.cakeRaceMode.LocalPlayerIsWinner);
        yield return(new WaitForSeconds(0.5f));

        Vector3 fromPosition = this.controlsPanel.localPosition;
        float   fade         = 0f;

        while (fade < 1f)
        {
            fade += GameTime.RealTimeDelta * 2f;
            this.controlsPanel.localPosition = Vector3.Lerp(fromPosition, this.originalControlsPanelPosition, fade);
            yield return(null);
        }
        this.controlsPanel.localPosition = this.originalControlsPanelPosition;
        if (PlayerProgressBar.Instance)
        {
            float burstRate = (float)this.cakeRaceMode.GainedXP / 0.6f;
            PlayerProgressBar.Instance.AddParticles(this.scoreAnimation.gameObject, this.cakeRaceMode.GainedXP, 0f, burstRate, null);
        }
        this.SpawnReward();
        yield break;
    }