Exemplo n.º 1
0
 private void RegisterAnimationQueue(Queue <ScoreData> animationWorkQueue, ScoreContainer score)
 {
     if (score.getGameMode() == GameMode.NormalMode)
     {
         AddAnimationEntry(animationWorkQueue, HighscoreType.WaveCount, score.getWaveMultiplier(), score.getWaveScore());
     }
     else
     {
         AddAnimationEntry(animationWorkQueue, HighscoreType.WaveCount, score.getYoloScore(), score.getYoloScore());     // Only show wave score not the multiplier -> In YOLO-Mode there should be no wave multiplier
     }
     AddAnimationEntry(animationWorkQueue, HighscoreType.PolygonTriggered, score.getPolysTriggered(), score.getPolysTriggeredScore());
     AddAnimationEntry(animationWorkQueue, HighscoreType.PolyKill, score.getPolyKills(), score.getPolyKillsScore());
     AddAnimationEntry(animationWorkQueue, HighscoreType.LinecutKill, score.getCutKills(), score.getCutKillsScore());
     AddAnimationEntry(animationWorkQueue, HighscoreType.BossKill, score.getBossKills(), score.getBossKillsScore());
     AddAnimationEntry(animationWorkQueue, HighscoreType.PowerUpsGathered, score.getPowerupsCollected(), score.getPowerupsCollectedScore());
     AddAnimationEntry(animationWorkQueue, HighscoreType.RevivalExpenses, score.getPlayerRevivals(), score.getPlayerRevivalsScore());
 }
Exemplo n.º 2
0
    /// <summary>
    /// Shows the calculated values, the total score and the rank.
    /// </summary>
    /// <returns></returns>
    private IEnumerator StartAnimationPhase03()
    {
        ScoreContainer    score = DataCollector.instance.getScoreContainer();
        Queue <ScoreData> animationWorkQueue = new Queue <ScoreData>();
        string            onlineRankString;

        if (BaseSteamManager.Instance.GetRank() == 0)
        {
            onlineRankString = "";
        }
        else
        {
            onlineRankString = string.Format(rankString, BaseSteamManager.Instance.GetRank());
        }

        RegisterAnimationQueue(animationWorkQueue, score);

        confetti.Play();

        // Set each score values to the calculated score
        foreach (var highscoreEntry in highscoreEntries)
        {
            ScoreData currentScore = animationWorkQueue.Dequeue();
            highscoreEntry.Value.scoreText.text = string.Format("{0:0,0}", currentScore.scoreValue);
            DoScaleTween(highscoreEntry.Value.scoreText.rectTransform, scaleTime, upScale);
            countFinishedSound.Play();
            yield return(waitForNextLine);
        }

        // Set score
        StringBuilder timeString = null;

        scoreSound.Play();
        if (score.getGameMode() == GameMode.NormalMode)
        {
            scoreText.text = CreateHighscoreString((int)score.getWave(), score.getScoreSum(), "");
        }
        else
        {
            TimeUtil time = TimeUtil.MillisToTime(score.getYoloScore());
            timeString = new StringBuilder(string.Format("{0:00}", time.Minute))
                         .Append(":")
                         .Append(string.Format("{0:00}", time.Second))
                         .Append(":")
                         .Append(string.Format("{0:000}", time.Milliseconds));
            scoreText.text = CreateHighscoreString(timeString.ToString(), score.getScoreSum(), "");
        }

        DoScaleTween(scoreText.rectTransform, scaleTime, scoreTextUpScale);
        yield return(new WaitForSeconds(totalScoreTime));

        endOfAnimationReached = true;

        // Set online rank
        scoreSound.Play();
        if (score.getGameMode() == GameMode.NormalMode)
        {
            scoreText.text = CreateHighscoreString((int)score.getWave(), score.getScoreSum(), onlineRankString);
        }
        else
        {
            scoreText.text = CreateHighscoreString(timeString.ToString(), score.getScoreSum(), onlineRankString);
        }

        DoScaleTween(scoreText.rectTransform, scaleTime, scoreTextUpScale);
    }