public void RefreshAvailableOfficesList() { foreach (Transform child in OfficesForSaleList) { Destroy(child.gameObject); } for (int i = 0; i < OFFICES_TO_GENERATE; i++) { CompanyOfficeItem new_office_item = Instantiate(CompanyOfficeItemPrefab); new_office_item.PopulateData(Office.GenerateOffice()); new_office_item.transform.SetParent(OfficesForSaleList, false); } PopulateOfficeDetail(Company.MyCompany.CompanyOffices[0]); }
public void RefreshCurrentOfficesList() { foreach (Transform child in CurrentOfficesList) { Destroy(child.gameObject); } foreach (Office office in Company.MyCompany.CompanyOffices) { CompanyOfficeItem new_office_item = Instantiate(CompanyOfficeItemPrefab); new_office_item.PopulateData(office); new_office_item.transform.SetParent(CurrentOfficesList, false); } PopulateOfficeDetail(Company.MyCompany.CompanyOffices[0]); }