private void LoadTeamCollection() { using (StreamReader stream = new StreamReader(_jsonPath)) { string json = stream.ReadToEnd(); teamCollection = JsonUtility.FromJson <TeamCollection>(json); } CreateUIData(teamCollection); }
private void CreateUIData(TeamCollection team) { _titleText.text = team.Title; foreach (var data in team.Data) { GameObject newRow = Instantiate(rowPrefab, _tableContainer); newRow.GetComponent <UIModel>().idText.text = data.ID; newRow.GetComponent <UIModel>().nameText.text = data.Name; newRow.GetComponent <UIModel>().roleText.text = data.Role; newRow.GetComponent <UIModel>().nicknameText.text = data.Nickname; } foreach (var header in team.ColumnHeaders) { GameObject newHeaders = Instantiate(headersPrefab, _hadersContainer); newHeaders.GetComponent <UIModel>().idText.text = header.ID.ToUpper(); newHeaders.GetComponent <UIModel>().nameText.text = header.Name.ToUpper(); newHeaders.GetComponent <UIModel>().roleText.text = header.Role.ToUpper(); newHeaders.GetComponent <UIModel>().nicknameText.text = header.Nickname.ToUpper(); } }