IEnumerator RefreshHighScores() { while (true) { highscoreManager.Download(); yield return(new WaitForSeconds(30)); } }
private void Start() { for (int i = 0; i < highscoreText.Length; i++) { highscoreText[i].text = i + 1 + ". Fetching..."; } highscoreManager = GetComponent <Highscores>(); highscoreManager.Download(); StartCoroutine(RefreshHighScores()); }