コード例 #1
0
    public void SetInfo(ProtoData.RaidRankingData.RankingData rankingData, TierSprite tier)
    {
        if (rankingData == null)
        {
            nicknameText.gameObject.SetActive(false);
            scoreText.gameObject.SetActive(false);
            rankImage.gameObject.SetActive(false);
            numberRank.rankImage.gameObject.SetActive(false);
            iconImage.gameObject.SetActive(false);
            return;
        }
        else
        {
            nicknameText.gameObject.SetActive(true);
            scoreText.gameObject.SetActive(true);
            rankImage.gameObject.SetActive(true);
            numberRank.rankImage.gameObject.SetActive(true);
            iconImage.gameObject.SetActive(true);
        }

        nicknameText.text = rankingData.nickname;
        scoreText.text    = rankingData.score.ToString("n0");
        switch (rankingData.ranking)
        {
        case 1:
            numberRank.rankImage.enabled = true;
            numberRank.rankImage.sprite  = rankSprites[0];
            numberRank.rankText.gameObject.SetActive(false);
            break;

        case 2:
            numberRank.rankImage.enabled = true;
            numberRank.rankImage.sprite  = rankSprites[1];
            numberRank.rankText.gameObject.SetActive(false);
            break;

        case 3:
            numberRank.rankImage.enabled = true;
            numberRank.rankImage.sprite  = rankSprites[2];
            numberRank.rankText.gameObject.SetActive(false);
            break;

        default:
            numberRank.rankImage.enabled = false;
            numberRank.rankText.gameObject.SetActive(true);
            numberRank.rankText.text = rankingData.ranking.ToString( );
            break;
        }

        if (tier != null)
        {
            rankImage.sprite = tier.sprite;
        }

        if (rankingData.index > 0)
        {
            iconImage.sprite = indexSprites[rankingData.index - 1];
        }
    }
コード例 #2
0
 public void SetInfoForLastHitRnaking(ProtoData.RaidRankingData.RankingData rankingData)
 {
     if (rankingData != null)
     {
         lastHitRanking.SetInfo(rankingData, tierSpriteList.Find(x => (int)x.tier == rankingData.tier));
     }
     else
     {
         lastHitRanking.SetInfo(null, null);
     }
 }
コード例 #3
0
 public void SetInfoForMyRanking(ProtoData.RaidRankingData.RankingData rankingData)
 {
     myRanking.SetInfo(rankingData, tierSpriteList.Find(x => (int)x.tier == rankingData.tier));
 }