public void AddNewItem(string inputText, SW_Column column) { SW_Item tempItem = Instantiate(Overlord.ItemPrefab); tempItem.transform.SetParent(transform, false); tempItem.Initialize(column, inputText, Overlord, this); Items.Add(tempItem); }
public void AddNewItem(string inputText, string navigation, SW_Column column) { SW_Item tempItem = Instantiate(Overlord.ItemNavPrefab); tempItem.transform.SetParent(transform, false); tempItem.Initialize(column.minWidth, column.flexWidth, inputText, Overlord, this, navigation); Items.Add(tempItem); }
public void Initialize(SW_Column column, string text, SW_Table_Overlord overlord, SW_Row row) { layout = GetComponent <LayoutElement>(); textUI = GetComponentInChildren <TextMeshProUGUI>(); if (!textUI) { textUI = GetComponent <TextMeshProUGUI>(); } Overlord = overlord; itemRow = row; textUI.text = text; Value = text; layout.minWidth = column.minWidth; if (column.flexWidth) { layout.flexibleWidth = 1; } }