private IEnumerator WaitForDatabaseSearch() { CategoryListPanel.SetActive(false); for (int i = 0; i < 2; i++) { yield return(null); } List <Category> categories = DatabaseConnection.GetCategories(); SpawnCategories(categories); }
private void SpawnCategories(List <Category> categories) { NoCategoriesText.SetActive(false); if (categories.Count == 0) { NoCategoriesText.SetActive(true); } foreach (Category category in categories) { Admin_CategoryLineEdit newCategory = Instantiate(CategoryLinePrefab, CategoryParent, false).GetComponent <Admin_CategoryLineEdit>(); newCategory.SetCategoryInfo(category); CategoryLineList.Add(newCategory); newCategory.gameObject.SetActive(true); } CategoryListPanel.SetActive(true); }