コード例 #1
0
    //------------------------------------------------------------------------------------------------------------------
    void UpdateLines()
    {
        if ((m_Lines == null) || (m_Lines.Length == 0))
        {
            return;
        }

        int highlight = -1;
        PlayerPersistantInfo        local         = PPIManager.Instance.GetLocalPlayerPPI();
        List <PlayerPersistantInfo> original      = PPIManager.Instance.GetPPIList();
        List <PlayerPersistantInfo> sortedByTeam  = new List <PlayerPersistantInfo>(original);
        List <PlayerPersistantInfo> sortedByScore = new List <PlayerPersistantInfo>(original);

        m_FirstTeam = local.Team;

        sortedByTeam.Sort(ComparePPIsByTeam);
        sortedByScore.Sort(ComparePPIsByScore);

        for (int i = 0; i < m_Lines.Length; ++i)
        {
            ChartLine line = m_Lines[i];

            if (i < sortedByTeam.Count)
            {
                PlayerPersistantInfo ppi = sortedByTeam[i];
                Color col = GetColor(ppi);
                int   idx = GetIndex(ppi, sortedByScore) + 1;

                line.Show();
                line.Update(ppi, idx, col);

                if (ppi.Player == local.Player)
                {
                    m_PlayerPlace = idx;
                    highlight     = i;
                }
            }
            else
            {
                line.Hide();
            }
        }

        UpdateHighlighiting(highlight);
    }