Exemplo n.º 1
0
        public IEnumerator Init(StatBoard.PlayerStatData statData)
        {
            m_nameText.SetText(statData.name);
            Color color = statData.ally ? m_statData.allyColor : m_statData.opponentColor;

            m_nameText.color       = color;
            m_bestPlayerText.color = color;
            m_crownImage.set_color(color);
            GameStatistics.Types.PlayerStats playerStats = statData.playerStats;
            bool flag = statData.playerStats.Titles.Contains(0);

            m_bestPlayerText.get_gameObject().SetActive(flag);
            float num = flag ? m_statData.illuMvpScale : m_statData.illuNeutralScale;

            m_illuContainer.set_localScale(Vector3.get_one() * num);
            int num2 = default(int);

            if (playerStats.Stats.TryGetValue(12, ref num2))
            {
                m_deadIcon.get_gameObject().SetActive(num2 > 0);
            }
            else
            {
                m_deadIcon.get_gameObject().SetActive(true);
            }
            yield return(LoadIllu(statData.weaponDefinition));
        }
Exemplo n.º 2
0
        public IEnumerator Init(GameStatistics gameStatistics)
        {
            m_allies.Clear();
            m_opponents.Clear();
            m_availableStats.Clear();
            RepeatedField <GameStatistics.Types.PlayerStats> playerStats = gameStatistics.PlayerStats;

            for (int i = 0; i < playerStats.get_Count(); i++)
            {
                GameStatistics.Types.PlayerStats playerStats2 = playerStats.get_Item(i);
                for (int j = 0; j < playerStats2.Titles.get_Count(); j++)
                {
                    FightStatType item = (FightStatType)playerStats2.Titles.get_Item(j);
                    if (!m_availableStats.Contains(item))
                    {
                        m_availableStats.Add(item);
                    }
                }
                if (GameStatus.GetFightStatus(playerStats2.FightId).TryGetEntity(playerStats2.PlayerId, out PlayerStatus entityStatus) && entityStatus.heroStatus != null)
                {
                    PlayerStatData playerStatData = default(PlayerStatData);
                    playerStatData.name             = entityStatus.nickname;
                    playerStatData.weaponDefinition = (WeaponDefinition)entityStatus.heroStatus.definition;
                    playerStatData.playerStats      = playerStats2;
                    PlayerStatData item2 = playerStatData;
                    if (GameStatus.localPlayerTeamIndex == entityStatus.teamIndex)
                    {
                        item2.ally = true;
                        m_allies.Add(item2);
                    }
                    else
                    {
                        item2.ally = false;
                        m_opponents.Add(item2);
                    }
                }
            }
            PlayerStatDataComparer comparer = new PlayerStatDataComparer();

            m_allies.Sort(comparer);
            m_opponents.Sort(comparer);
            if (GameStatus.fightType == FightType.TeamVersus)
            {
                m_teamScoreLine.get_gameObject().SetActive(true);
                m_allyTeamScore.SetText(GameStatus.allyTeamPoints.ToString());
                m_opponentTeamScore.SetText(GameStatus.opponentTeamPoints.ToString());
            }
            else
            {
                m_teamScoreLine.get_gameObject().SetActive(false);
            }
            bool displayOpponent = m_opponents.Count > 0 || GameStatus.fightType != FightType.BossFight;

            m_versusImage.get_gameObject().SetActive(displayOpponent);
            m_versusBloom.get_gameObject().SetActive(displayOpponent);
            yield return(m_playerLine.Init(m_allies, m_opponents, displayOpponent));

            m_statLines[0].Init(m_allies, m_opponents, FightStatType.TotalDamageDealt, displayOpponent);
            m_statLines[1].Init(m_allies, m_opponents, FightStatType.TotalDamageSustained, displayOpponent);
            m_statLines[2].Init(m_allies, m_opponents, FightStatType.PlayTime, displayOpponent);
            m_statLines[3].Init(m_allies, m_opponents, FightStatType.TotalKills, displayOpponent);
            InitOptionnalLine(m_statLines[4], FightStatType.CompanionGiven, displayOpponent);
            InitOptionnalLine(m_statLines[5], FightStatType.BudgetPointsDiff, displayOpponent);
            InitOptionnalLine(m_statLines[6], FightStatType.BudgetPointsWon, displayOpponent);
        }