public IEnumerator CoroutineFillGlobalRankingScore() { int indexChild = 0; foreach (Transform child in this.GlobalRankingScrollContent.transform) { if (indexChild != 0) { //DO NOT DESTROY THE HEADER Destroy(child.gameObject); } indexChild++; } int position = 1; foreach (ModelScore oneScore in this.globalScores) { GameObject myScore = Instantiate(this.PrefabScore); myScore.transform.SetParent(this.GlobalRankingScrollContent.transform); ScorePanel scorePanel = myScore.GetComponent <ScorePanel>(); scorePanel.score = oneScore.score.ToString(); scorePanel.username = oneScore.name; scorePanel.position = position.ToString(); scorePanel.InitText(); position++; } this.scrollbarGlobalRanking.value = 1; this.loader.SetActive(false); yield return(null); }