private void onTimerUpdated(int milliseconds) { if (shouldUpdateTime) { timerText.text = TimerMethods.FormatTimerString(milliseconds); } }
public void onClickPlayMenuDebugMode() { speedModeButton.interactable = true; accuracyModeButton.interactable = true; debugModeButton.interactable = false; chosenGameMode = GameMode.Debug; playModeDescriptionText.text = "What do you want me to say, Karen?\n\n"; playModeTitleText.text = "DEBUG MODE"; if (PlayerPrefs.HasKey(GameController.PREFS_KEY_HIGH_SCORE_DEBUG)) { int highScore = PlayerPrefs.GetInt(GameController.PREFS_KEY_HIGH_SCORE_DEBUG); playModeDescriptionText.text += "High Score: " + highScore.ToString() + "\n"; } if (PlayerPrefs.HasKey(GameController.PREFS_KEY_BEST_TIME_DEBUG)) { int bestTime = PlayerPrefs.GetInt(GameController.PREFS_KEY_BEST_TIME_DEBUG); string bestTimeString = TimerMethods.FormatTimerString(bestTime); playModeDescriptionText.text += "Best Time: " + bestTimeString; } }
public void onClickPlayMenuAccuracyMode() { speedModeButton.interactable = true; accuracyModeButton.interactable = false; debugModeButton.interactable = true; chosenGameMode = GameMode.Accuracy; playModeTitleText.text = "PRECISION MODE"; playModeDescriptionText.text = "Take it easy and line up your shots. Score points by sinking holes at a longer distance.\n\nTip: Make sure to account for the ball's curve; it's affected by the gravity of the black hole.\n\n"; if (PlayerPrefs.HasKey(GameController.PREFS_KEY_HIGH_SCORE_ACCURACY)) { int highScore = PlayerPrefs.GetInt(GameController.PREFS_KEY_HIGH_SCORE_ACCURACY); playModeDescriptionText.text += "High Score: " + highScore.ToString() + "\n"; } if (PlayerPrefs.HasKey(GameController.PREFS_KEY_BEST_TIME_ACCURACY)) { int bestTime = PlayerPrefs.GetInt(GameController.PREFS_KEY_BEST_TIME_ACCURACY); string bestTimeString = TimerMethods.FormatTimerString(bestTime); playModeDescriptionText.text += "Best Time: " + bestTimeString; } }
public void onClickPlayMenuSpeedMode() { speedModeButton.interactable = false; accuracyModeButton.interactable = true; debugModeButton.interactable = true; chosenGameMode = GameMode.Speed; playModeTitleText.text = "CHAOS MODE"; playModeDescriptionText.text = "Fly at break-neck speeds, performing daring maneuvers in order to sink your holes as fast as humanly possible.\n\nTip: Stay near the black hole to maintain speed, but don't get sucked in!\n\n"; if (PlayerPrefs.HasKey(GameController.PREFS_KEY_HIGH_SCORE_SPEED)) { int highScore = PlayerPrefs.GetInt(GameController.PREFS_KEY_HIGH_SCORE_SPEED); playModeDescriptionText.text += "High Score: " + highScore.ToString() + "\n"; } if (PlayerPrefs.HasKey(GameController.PREFS_KEY_BEST_TIME_SPEED)) { int bestTime = PlayerPrefs.GetInt(GameController.PREFS_KEY_BEST_TIME_SPEED); string bestTimeString = TimerMethods.FormatTimerString(bestTime); playModeDescriptionText.text += "Best Time: " + bestTimeString; } }