public SongLengthCalculator() { SongLengthCalculator.songDataHolder = UnityEngine.Object.FindObjectOfType <SongDataHolder>(); SongLengthCalculator.songCues = UnityEngine.Object.FindObjectOfType <SongCues>(); SongLengthCalculator.scoreKeeperDisplay = UnityEngine.Object.FindObjectOfType <ScoreKeeperDisplay>(); this.Precalc(); }
public static void ScoreKeeperDisplayUpdate(ScoreKeeperDisplay scoreKeeperDisplay) { if (!KataConfig.I.practiceMode) { int score = ScoreKeeper.I.mScore; float percentage = GetScorePercentage(selectedSong, score, KataConfig.I.GetDifficulty()); //Make pretty-ish strings string scoreString = "<size=" + inGameCurrentScoreSize + ">" + String.Format("{0:n0}", score).Replace(",", " ") + "</size>"; string percentageString = "<size=" + inGameCurrentPercentSize + "> (" + String.Format("{0:0.00}", percentage) + "%)</size>"; scoreKeeperDisplay.scoreDisplay.text = scoreString + percentageString; HighScoreRecords.HighScoreInfo highScoreInfo = HighScoreRecords.GetHighScore(selectedSong); float highScore = Convert.ToSingle(highScoreInfo.score); float highScorePercentage = GetHighScorePercentage(selectedSong); string highScoreString = "<size=" + inGameHighScoreSize + ">" + String.Format("{0:n0}", highScore).Replace(",", " ") + "</size>"; string highScorePercentageString = "<size=" + inGamePercentSize + "> (" + String.Format("{0:0.00}", highScorePercentage) + "%)</size>"; scoreKeeperDisplay.highScoreDisplay.text = "<size=" + inGameHighScoreLabelSize + ">" + inGameHighScoreLabelText + "</size>" + highScoreString + highScorePercentageString; } }
private static void Postfix(ScoreKeeperDisplay __instance) { AudicaMod.ScoreKeeperDisplayUpdate(__instance); }