IEnumerator WatchRaceStatus() { //Debug.Log("UiManager.WatchRaceStatus"); while (RaceManager.IsRaceInProgress() == false) { yield return(null); } CountdownTimerHud.Hide(); raceButton.GetComponentInChildren <Text>().text = Constants.StopRace; raceInfoHud.StartWatchRaceStatus(); while (RaceManager.IsRaceInProgress() == true) { yield return(new WaitForSeconds(0.1f)); } if (RaceManager.IsReady()) { closeRaceInfoHudButton.gameObject.SetActive(true); } raceButton.GetComponentInChildren <Text>().text = Constants.StartRace; }
void ResetFlightPanel() { GameManager.StopGame(); RaceManager.StopRace(); HideRaceInfoHud(); CountdownTimerHud.Hide(); HideArmedIndicator(); raceButton.GetComponentInChildren <Text>().text = Constants.StartRace; }
void Awake() { if (instance == null) { instance = this; } else { Debug.LogError("CountdownTimerUi has already been created."); } Hide(true); }
public void Race() { if (RaceManager.IsRaceInProgress() == true) { RaceManager.StopRace(); } else if (RaceManager.IsGetReady() == false) { raceButton.GetComponentInChildren <Text>().text = Constants.GetReadyToRace; RaceManager.GetReadyToRace(); CountdownTimerHud.Show(); closeRaceInfoHudButton.gameObject.SetActive(false); raceInfoHud.gameObject.SetActive(true); raceInfoHud.StartWatchRaceStatus(); StartCoroutine(WatchRaceStatus()); } }