Exemplo n.º 1
0
    protected override void OnViewUpdate()
    {
        base.OnViewUpdate();

        if (IsInvalid(InvalidationFlag.DYNAMIC_DATA) && _playerStateList != null)
        {
            for (int i = 0; i < PlayerGroup.kMaxPlayerCount; ++i)
            {
                if (i < _playerStateList.Count)
                {
                    PlayerMatchRank state = _playerStateList[i];
                    _placingUI[i].playerName.text = state.name;
                    _placingUI[i].finalScore.text = string.Format("Score: {0}", state.score);
                }
                else
                {
                    _placingUI[i].gameObject.SetActive(true);
                }
            }
        }
    }
Exemplo n.º 2
0
    public static MatchOverEvent Create(List <PlayerState> playerRanking)
    {
        MatchOverEvent         turn     = new MatchOverEvent();
        List <PlayerMatchRank> rankList = new List <PlayerMatchRank>(playerRanking.Count);

        for (int i = 0; i < playerRanking.Count; ++i)
        {
            PlayerState     state      = playerRanking[i];
            PlayerMatchRank playerRank = new PlayerMatchRank()
            {
                name              = state.name,
                score             = state.score,
                cardCount         = state.deadCustomerStack.Count,
                positiveCardCount = state.positiveCustomerCount
            };

            rankList.Add(playerRank);
        }

        turn.playerRanking = rankList;
        return(turn);
    }