public void EndDisplay(int score) { SetCursor(false); scope.SetActive(false); scoretable.SetActive(true); slagent.SavePlayer(SLAgent.LoadName(), score); List <SLAgent.TopTab> list = slagent.LoadTop(); foreach (Transform child in pltoptabcont.transform) { Destroy(child.gameObject); } if (list.Count > 0) { for (int i = 0; i < list.Count; i++) { var inst = Instantiate(pltoptabchild); inst.transform.SetParent(pltoptabcont.transform, false); inst.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = list[i].name; inst.transform.GetChild(1).GetComponent <TextMeshProUGUI>().text = Convert.ToString(list[i].score); } } }
public void SetName() => SLAgent.SaveName(inp.GetComponent <TMPro.TextMeshProUGUI>().text);