Esempio n. 1
0
            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);
            }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
 public void AddCell(ReferenceCell cell) => _cells.Add(cell);
Esempio n. 4
0
 public void RemoveCell(ReferenceCell cell) => _cells.Remove(cell);
Esempio n. 5
0
 protected virtual void ReferenceCell_Changed(ReferenceCell referenceCell)
 {
 }