private static GameObject GenerateTableObj(T_Table table, Transform harness) { GameObject currentTable = Generate((int)View_Type.Table); Transform tableTransform = currentTable.transform; List <T_Column> columnInfo = table.ChildColumns; int columnCount = columnInfo.Count; GameObject[] cols = new GameObject[columnCount]; for (int i = 0; i < columnCount; i++) { cols[i] = GenerateColumnObj(columnInfo[i], tableTransform, i); } currentTable.GetComponent <Table>().initialization(cols, harness); return(currentTable); }
// Update is called once per frame void Update() { if (virgin) { virgin = false; T_Column col1 = new T_Column(); col1.Name = "Name1"; col1.ColumnKey = 0; T_Column col2 = new T_Column(); col2.Name = "Name2"; col2.ColumnKey = 1; List <T_Column> colSet = new List <T_Column>(); colSet.Add(col1); colSet.Add(col2); List <T_Column> colSet2 = new List <T_Column>(); colSet2.Add(col1); colSet2.Add(col2); T_Table tab1 = new T_Table(); tab1.TableKey = 0; tab1.Name = "TabName1"; tab1.ChildColumns = colSet; T_Table tab2 = new T_Table(); tab2.TableKey = 1; tab2.Name = "TabName2"; tab2.ChildColumns = colSet2; List <T_Table> tabSet = new List <T_Table>(); tabSet.Add(tab1); tabSet.Add(tab2); T_Harness harness = new T_Harness(); harness.childTables = tabSet; GameObject sample = ViewAssembler.GenerateViewObject(harness); sample.name = "Rex"; } }