示例#1
0
    public int RefreshPlayerList(Filter.Mode mode, SortDropdown.SortMode sortMode, GameObject content, StartingMemberFilter startingMemberFilter = StartingMemberFilter.ALL, PlayerList.PlayerView playerView = PlayerList.PlayerView.SKILLS_AND_STATISTICS)
    {
        currentStartingMemberFilter = startingMemberFilter;
        isModeNow = true;

        int instantiatedAmount = 0;

        //Removes children of player content.
        for (int i = 0; i < content.transform.childCount; ++i)
        {
            Transform child = content.transform.GetChild(i);
            Destroy(child.gameObject);
        }

        PlayerSort(Values.myTeam.players.d, sortMode);

        //Instantiates playerPanel to it.
        for (int i = 0; i < Values.myTeam.players.d.Count; ++i)
        {
            if (startingMemberFilter == StartingMemberFilter.MEMBER_EXCLUDED && Values.myTeam.players[i].Value.isStartingMember && !Values.myTeam.players[i].Value.isSubstitute)
            {
                continue;
            }
            else if (startingMemberFilter == StartingMemberFilter.MEMBER_ONLY && !Values.myTeam.players[i].Value.isStartingMember)
            {
                continue;
            }
            else if (startingMemberFilter == StartingMemberFilter.SUB_ONLY && !Values.myTeam.players[i].Value.isSubstitute)
            {
                continue;
            }
            else if (startingMemberFilter == StartingMemberFilter.SUB_EXCLUDED && Values.myTeam.players[i].Value.isSubstitute)
            {
                continue;
            }

            if (mode == Filter.Mode.BATTERS && Values.myTeam.players[i].Value.GetType() == typeof(Pitcher))
            {
                continue;
            }
            else if (mode == Filter.Mode.PITCHERS && Values.myTeam.players[i].Value.GetType() == typeof(Batter))
            {
                continue;
            }

            ++instantiatedAmount;
            PlayerInstantiate(Values.myTeam.players[i].Value, content, playerView);
        }

        return(instantiatedAmount);
    }
示例#2
0
    public int RefreshPlayerList(Player.MetaPosition metaPosition, SortDropdown.SortMode sortMode, StartingMemberFilter startingMemberFilter = StartingMemberFilter.ALL, PlayerList.PlayerView playerView = PlayerList.PlayerView.SKILLS_AND_STATISTICS)
    {
        currentStartingMemberFilter = startingMemberFilter;
        isModeNow           = false;
        currentMetaPosition = metaPosition;

        int instantiatedAmount = 0;

        //Removes children of player content.
        for (int i = 0; i < playerContent.transform.childCount; ++i)
        {
            Transform child = playerContent.transform.GetChild(i);
            Destroy(child.gameObject);
        }

        PlayerSort(Values.myTeam.players.d, sortMode);

        //Instantiates playerPanel to it.
        for (int i = 0; i < Values.myTeam.players.d.Count; ++i)
        {
            if (startingMemberFilter == StartingMemberFilter.MEMBER_EXCLUDED && Values.myTeam.players[i].Value.isStartingMember && !Values.myTeam.players[i].Value.isSubstitute)
            {
                continue;
            }
            else if (startingMemberFilter == StartingMemberFilter.MEMBER_ONLY && !Values.myTeam.players[i].Value.isStartingMember)
            {
                continue;
            }
            else if (startingMemberFilter == StartingMemberFilter.SUB_ONLY && !Values.myTeam.players[i].Value.isSubstitute)
            {
                continue;
            }
            else if (startingMemberFilter == StartingMemberFilter.SUB_EXCLUDED && Values.myTeam.players[i].Value.isSubstitute)
            {
                continue;
            }

            if (Values.myTeam.players[i].Value.playerData.GetData(PlayerData.PP.META_POSITION) != metaPosition)
            {
                continue;
            }

            ++instantiatedAmount;
            PlayerInstantiate(Values.myTeam.players[i].Value, playerView);
        }

        return(instantiatedAmount);
    }