Make high score text highlighted
This commit is contained in:
@@ -581,12 +581,16 @@ public class GamePlayer : MonoBehaviour
|
|||||||
|
|
||||||
void UpdateStats(BigInteger scoreAddAmount, BigInteger attemptAddAmount)
|
void UpdateStats(BigInteger scoreAddAmount, BigInteger attemptAddAmount)
|
||||||
{
|
{
|
||||||
|
var prefix = "";
|
||||||
|
var suffix = "";
|
||||||
score += scoreAddAmount;
|
score += scoreAddAmount;
|
||||||
totalAttempts += attemptAddAmount;
|
totalAttempts += attemptAddAmount;
|
||||||
attempts += attemptAddAmount;
|
attempts += attemptAddAmount;
|
||||||
if (score > highscore)
|
if (score >= highscore)
|
||||||
{
|
{
|
||||||
highscore = score;
|
highscore = score;
|
||||||
|
prefix = "<color=#7FFFD4>";
|
||||||
|
suffix = "</color>";
|
||||||
}
|
}
|
||||||
BazookaManager.Instance.SetGameStoreHighScore(highscore);
|
BazookaManager.Instance.SetGameStoreHighScore(highscore);
|
||||||
BazookaManager.Instance.SetGameStoreTotalNormalBerries(totalNormalBerries);
|
BazookaManager.Instance.SetGameStoreTotalNormalBerries(totalNormalBerries);
|
||||||
@@ -600,7 +604,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
customBirdIconData.Balance = totalCoins;
|
customBirdIconData.Balance = totalCoins;
|
||||||
BazookaManager.Instance.SetCustomBirdIconData(customBirdIconData);
|
BazookaManager.Instance.SetCustomBirdIconData(customBirdIconData);
|
||||||
scoreText.text = $"Score: {Tools.FormatWithCommas(score)} \\u2022 Attempts: {Tools.FormatWithCommas(attempts)}";
|
scoreText.text = $"Score: {Tools.FormatWithCommas(score)} \\u2022 Attempts: {Tools.FormatWithCommas(attempts)}";
|
||||||
highScoreText.text = $"High Score: {Tools.FormatWithCommas(highscore)} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
highScoreText.text = prefix + $"High Score: {Tools.FormatWithCommas(highscore) + suffix} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
||||||
coinText.text = $"Coins: {Tools.FormatWithCommas(totalCoins)}";
|
coinText.text = $"Coins: {Tools.FormatWithCommas(totalCoins)}";
|
||||||
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user