Beispiel #1
0
 public void ShowUnitList(List <Unit> list, BattlefieldUiIndex uiIndex)
 {
     if (IsInit)
     {
         table.ClreanTable(false);
     }
     Init();
     TableCell[] row = new TableCell[6];
     foreach (var item in list)
     {
         if (item == null)
         {
             continue;
         }
         //row[0] = table.CreateInputFieldTableCell(item.Setting.Name);
         UnitSummaryData data = item.GetSummary();
         row[0] = table.CreateTableButtonCell(data.name, (cell) => { uiIndex.ShowInfoWindow(data.name + ":\n" + item.Setting.Introduce); });
         row[1] = table.CreateInputFieldTableCell(data.Hp + "");
         row[2] = table.CreateInputFieldTableCell(data.Ad + "");
         row[3] = table.CreateInputFieldTableCell(data.Ed + "");
         row[4] = table.CreateInputFieldTableCell(data.Count + "/" + data.AllCount + "");
         row[5] = table.CreateInputFieldTableCell(data.Morale + "");
         for (int i = 1; i < 6; i++)
         {
             ((TableInputFieldCell)row[i]).SetRacastTarget(false);
         }
         //row[3] = table.CreateTableButtonCell("详情", (cell) => { Debug.Log(cell.IndexRow + " " + cell.IndexColumn); });
         //row[4] = table.CreateTableButtonCell("给出", (cell) => { Debug.Log(cell.IndexRow + " " + cell.IndexColumn); });
         table.AddRow(row);
     }
     scroolrect.verticalNormalizedPosition = 1;
 }
Beispiel #2
0
    ///S查找 E显示
    public void NameSearchButtonOnclick <T>(Action <T> forS, Action <T> forE)
    {
        m_table.ClreanTable(false);

        List <T> list = new List <T>();

        foreach (var item in m_AllList)
        {
            list.Add((T)item);
        }

        m_AllList.Clear();

        list.ForEach(forS);

        RefreshTable(1, forE);

        if (m_table.m_TableRows.Count == 0)
        {
            NoHaveResuleLabel.SetActive(true);
        }
    }
Beispiel #3
0
    public void ShowUnitList(List <Unit> list, UnitTranPanelContorl contorl, Action <Unit> GetOutUnitToTeam, string strc = "给出")
    {
        if (IsInit)
        {
            table.ClreanTable(false);
        }
        Init();

        TableCell[] row = new TableCell[7];

        foreach (var item in list)
        {
            if (item == null)
            {
                continue;
            }
            //row[0] = table.CreateInputFieldTableCell(item.Setting.Name);
            row[0] = table.CreateTableButtonCell(item.Setting.Name, (cell) => { contorl.ShowInfoWindow(item.Setting.Name + ":\n" + item.Setting.Introduce); });
            row[1] = table.CreateInputFieldTableCell(item.Setting.HP + "");
            row[2] = table.CreateInputFieldTableCell(item.Setting.AD + "");
            row[3] = table.CreateInputFieldTableCell(item.Setting.DE + "");
            row[4] = table.CreateInputFieldTableCell(item.Setting.Price + "");
            row[5] = table.CreateInputFieldTableCell(item.Count + "");
            for (int i = 1; i < 5; i++)
            {
                ((TableInputFieldCell)row[i]).SetRacastTarget(false);
            }
            //row[3] = table.CreateTableButtonCell("详情", (cell) => { Debug.Log(cell.IndexRow + " " + cell.IndexColumn); });
            row[6] = table.CreateTableButtonCell(strc, (cell) => { GetOutUnitToTeam(item); });
            table.AddRow(row);
        }

        if (table.m_TableRows.Count == 0)
        {
            row[0] = table.CreateInputFieldTableCell("无");
            row[1] = table.CreateInputFieldTableCell("");
            row[2] = table.CreateInputFieldTableCell("");
            row[3] = table.CreateInputFieldTableCell("");
            row[4] = table.CreateInputFieldTableCell("");
            row[5] = table.CreateInputFieldTableCell("");
            row[6] = table.CreateInputFieldTableCell("");
            for (int i = 0; i < 6; i++)
            {
                ((TableInputFieldCell)row[i]).SetRacastTarget(false);
            }
            table.AddRow(row);
        }

        scroolrect.verticalNormalizedPosition = 1;
    }