void updateTourListOnAdd(string name, string time) { GameObject newSchedule = Instantiate(ListItemPrefab) as GameObject; LocationWithTimeItem controller = newSchedule.GetComponent <LocationWithTimeItem>(); controller.Name.text = name; controller.Time.text = time; newSchedule.transform.parent = ContentPanel.transform; newSchedule.transform.localScale = Vector3.one; }
void createScheduleList() { foreach (string s in locationsData.Keys) { GameObject newSchedule = Instantiate(ListItemPrefab) as GameObject; LocationWithTimeItem controller = newSchedule.GetComponent <LocationWithTimeItem>(); controller.Name.text = s; controller.Time.text = "Time : " + locationsData[s]; newSchedule.transform.parent = ContentPanel.transform; newSchedule.transform.localScale = Vector3.one; } locationsDisplayed = true; }