/** * Display all scores in the deathMenu */ private void DisplayScoring() { int score = scoreManager.GetScore(); int totalScore = score + coinsManager.CoinsScoring(); if (PlayerPrefs.GetInt("BodyMode") == 1) { int caloriesLost = caloriesManager.GetCaloriesLost(); int caloriesToLost = PlayerPrefs.GetInt("CaloriesToLost"); deathMenuScore.text = System.String.Format("Distance : {0}m\nCoins : {1}\nMultiplier : {2}x\nTotal Score : {3}\nCalories Lost : {4}", score, coinsManager.GetCoinsNumber(), coinsManager.GetCoinValue(), totalScore, caloriesLost); if (caloriesToLost > 0 && caloriesLost >= caloriesToLost) { caloriesGoalText.enabled = true; } } else { deathMenuScore.text = System.String.Format("Distance : {0}m\nCoins : {1}\nMultiplier : {2}x\nTotal Score : {3}", score, coinsManager.GetCoinsNumber(), coinsManager.GetCoinValue(), totalScore); } int highScore = scoreManager.GetHighScore(); if (totalScore > highScore) { UpdateHighScore(totalScore); } }
/** * Change the timer color according to your calorie and time goal */ private void ChangeTextColor() { int caloriesLost = caloriesManager.GetCaloriesLost(); if (actualTime <= (timer * 60) && caloriesLost >= caloriesToLost) { timeText.color = new Color(112 / 255f, 210 / 255f, 112 / 255f, 1); } else if (actualTime >= ((timer * 60) * 0.75f) && actualTime < (timer * 60) && caloriesLost < caloriesToLost) { timeText.color = new Color(253 / 255f, 182 / 255f, 27 / 255f, 1); } else if (actualTime >= (timer * 60)) { timeText.color = new Color(239 / 255f, 84 / 255f, 79 / 255f, 1); } }