public IEnumerator ShowStatistics() { Debug.Log("Show Statics"); yield return(StartCoroutine(DatabaseManager.GetHttp("Statistics.php"))); statsPanel.SetActive(true); DataBaseStatistic highscores = new DataBaseStatistic(); highscores = JsonUtility.FromJson <DataBaseStatistic>(DatabaseManager.response); nameText.text = ""; scoreText.text = ""; foreach (DatabaseHighScore scores in highscores.topofmonth) { nameText.text += scores.Username + "\n"; scoreText.text += scores.gemiddelde + "\n"; } }
public IEnumerator ShowStatistics() { yield return(StartCoroutine(DataBaseHandeler.GetHttp("statistics.php"))); Debug.Log("Response: " + DataBaseHandeler.response); DataBaseStatistic highscores = new DataBaseStatistic(); highscores = JsonUtility.FromJson <DataBaseStatistic>(DataBaseHandeler.response); Debug.Log("highscores: " + highscores.test); nameText.text = ""; scoreText.text = ""; foreach (DatabaseHighScore scores in highscores.topofmonth) { Debug.Log("Gemiddelde: " + scores.gemiddelde); nameText.text += scores.first_name + " " + scores.last_name + "\n"; scoreText.text += scores.gemiddelde + "\n"; } }