public static ReferenceCell Create(ReferenceCell referenceCellPrefab, Table referenceTable, IList <MaterialsTable.MaterialPanel> panels, int selected, string displayedCellName, Column column) { var cell = Instantiate(referenceCellPrefab, column.transform); cell._panels = new List <Panel>(panels); cell._selectedIndex = selected; cell._displayedCellName = displayedCellName; cell.UpdateDropdownOptions(); cell._dropdown.value = cell._selectedIndex; cell.Column = column; referenceTable.Added.AddListener(cell.Table_Added); foreach (var panel in cell._panels) { if (panel != null) { panel.Changed += cell.Panel_Changed; } } cell._dropdown.onValueChanged.AddListener(cell.Dropdown_OnValueChanged); referenceTable.Removed.AddListener(cell.Table_Removed); return(cell); }
public static ReferenceCell Create(ReferenceCell referenceCellPrefab, List <string> options, string displayedCellName, Column column) { var cell = Instantiate(referenceCellPrefab, column.transform); cell._displayedCellName = displayedCellName; cell.UpdateDropdownOptions(options); cell.SelectOption(displayedCellName); cell.Column = column; cell._dropdown.onValueChanged.AddListener(cell.Dropdown_OnValueChanged); return(cell); }
public void AddCell(ReferenceCell cell) => _cells.Add(cell);
public void RemoveCell(ReferenceCell cell) => _cells.Remove(cell);
protected virtual void ReferenceCell_Changed(ReferenceCell referenceCell) { }