public void PopulateRow() { foreach (GameObject row in rows) { //0 - 3 == idy = 0 // 3 -7 == idy = 1 //planeCount = 6, j == 6 int j = rows.IndexOf(row);// + (height * idy); DashboardRow dashboardrow = row.GetComponent <DashboardRow>(); if (plane.Count != table.RowCount()) { emptyRow(table.RowCount()); } if (j > table.GetTable().Count) { emptyRow(j); //dashboardrow.SetIndex(idx); } if (j < table.GetTable().Count) { List <string> data = table.GetTable() [j]; //dashboardrow.SetPlane(plane[j + (height * idy)]); dashboardrow.ChangeIdentifier(data [0]); dashboardrow.SetData(data.Skip(1).ToArray()); dashboardrow.SetIndex(idx); } } }
public void PopulateRow() { foreach (GameObject row in rows) { //string [] data =Aircraft_parent.transform.GetChild(i).GetComponent<movement>().GetData(); int j = rows.IndexOf(row); DashboardRow dashboardrow = row.GetComponent <DashboardRow>(); if (j + (height * idy) > plane.Count - 1) { dashboardrow.EmptyRow(); dashboardrow.SetIndex(idx); } else { //Debug.Log("Here"); dashboardrow.SetPlane(plane[j + (height * idy)]); //Debug.Log("Plane======================="+ plane[0]); var scene = SceneManager.GetActiveScene().name; if (scene == "ARScene") { string[] data = dashboardrow.GetPlane().GetComponent <movement>().GetData(); dashboardrow.ChangeIdentifier(data[0]); // SET TAIL ID dashboardrow.SetData(data.Skip(1).ToArray()); // dashboardrow.SetIndex(idx); } else if (scene == "LiveData") { string[] data = dashboardrow.GetPlane().GetComponent <AircraftDataManager>().GetData(); dashboardrow.ChangeIdentifier(data[0]); // SET TAIL ID dashboardrow.SetData(data.Skip(1).ToArray()); // dashboardrow.SetIndex(idx); } } } }