public void SortCharacterList()
    {
        CharacterListButton[]      componentsInChildren = this.charListContents.transform.GetComponentsInChildren <CharacterListButton>(true);
        List <CharacterListButton> list = new List <CharacterListButton>();

        foreach (CharacterListButton item in componentsInChildren)
        {
            list.Add(item);
        }
        CharacterListView.CharacterButtonComparer comparer = new CharacterListView.CharacterButtonComparer();
        list.Sort(comparer);
        for (int j = 0; j < list.Count; j++)
        {
            foreach (CharacterListButton characterListButton in componentsInChildren)
            {
                if (characterListButton.m_characterEntry.PlayerGuid == list[j].m_characterEntry.PlayerGuid)
                {
                    characterListButton.transform.SetSiblingIndex(j);
                    break;
                }
            }
        }
        for (int l = 0; l < list.Count; l++)
        {
            FancyEntrance component = list[l].GetComponent <FancyEntrance>();
            component.m_timeToDelayEntrance = this.m_listItemInitialEntranceDelay + this.m_listItemEntranceDelay * (float)l;
            component.Activate();
        }
    }
Example #2
0
    public void SortCharacterList()
    {
        CharacterListButton[]      componentsInChildren = this.charListContents.get_transform().GetComponentsInChildren <CharacterListButton>(true);
        List <CharacterListButton> list = new List <CharacterListButton>();

        CharacterListButton[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            CharacterListButton characterListButton = array[i];
            list.Add(characterListButton);
        }
        CharacterListView.CharacterButtonComparer characterButtonComparer = new CharacterListView.CharacterButtonComparer();
        list.Sort(characterButtonComparer);
        for (int j = 0; j < list.get_Count(); j++)
        {
            CharacterListButton[] array2 = componentsInChildren;
            for (int k = 0; k < array2.Length; k++)
            {
                CharacterListButton characterListButton2 = array2[k];
                if (characterListButton2.m_characterEntry.PlayerGuid == list.get_Item(j).m_characterEntry.PlayerGuid)
                {
                    characterListButton2.get_transform().SetSiblingIndex(j);
                    break;
                }
            }
        }
        for (int l = 0; l < list.get_Count(); l++)
        {
            FancyEntrance component = list.get_Item(l).GetComponent <FancyEntrance>();
            component.m_timeToDelayEntrance = this.m_listItemInitialEntranceDelay + this.m_listItemEntranceDelay * (float)l;
            component.Activate();
        }
    }