示例#1
0
 public void AddRows(List <List <string> > rowsData)
 {
     if (rowsData == null)
     {
         return;
     }
     for (int i = 0; i < rowsData.Count; i++)
     {
         if (i <= (dynamicRows.Count - 1))
         {
             dynamicRows[i].Build(rowsData[i]);
             dynamicRows[i].gameObject.SetActive(true);
         }
         else
         {
             DynamicRow newRow = Instantiate(prefDynamicRow, rowContent, false).GetComponent <DynamicRow>();
             if (newRow == null)
             {
                 Debug.LogError("Component [DynamicRow] missing in prefDynamicRow");
                 return;
             }
             newRow.Build(rowsData[i]);
             dynamicRows.Add(newRow);
         }
     }
 }
示例#2
0
        private void InitHeader()
        {
            if (dynamicHeader != null)
            {
                return;
            }
            DynamicRow newRow = Instantiate(prefDynamicRow, headerContent, false).GetComponent <DynamicRow>();

            if (newRow == null)
            {
                Debug.LogError("Component [DynamicRow] missing in prefDynamicRow");
                return;
            }
            dynamicHeader = newRow;
        }