private void PoolContents() { if (contentPrefab == null || contentContainer == null) { return; } for (int i = 0; i < poolCount; i++) { MenuContentLayout contentLayout = Instantiate(contentPrefab, contentContainer); contentLayout.OnSelect += OnContentClicked; contentLayoutList.Add(contentLayout); contentLayout.gameObject.SetActive(false); } }
private MenuContentLayout GetContentLayout() { MenuContentLayout currentContentLayout = null; foreach (MenuContentLayout contentLayout in contentLayoutList) { if (contentLayout.gameObject.activeInHierarchy) { continue; } contentLayout.gameObject.SetActive(true); currentContentLayout = contentLayout; break; } return(currentContentLayout); }
private void Internal_SetContents(MenuContent[] contents) { ClearContentLayout(); if (contents == null || contents.Length == 0) { return; } foreach (MenuContent content in contents) { MenuContentLayout layout = GetContentLayout(); if (layout == null) { break; } layout.Set(content.thumbnail, content.text); } }