Пример #1
0
 private void SetRank(int rank)
 {
     TextMeshHelper.ForceWrapText(this.rankLabel, (rank >= 0) ? rank.ToString() : "-", 3);
     this.rankLabel[0].transform.localScale = ((rank < 100) ? new Vector3(0.12f, 0.12f) : new Vector3(0.09f, 0.09f));
     if (this.rankIcons != null && this.trophyIcons != null)
     {
         if (rank < 0)
         {
             rank = 4;
         }
         for (int i = 0; i < this.rankIcons.Length; i++)
         {
             if (this.rankIcons[i] != null)
             {
                 this.rankIcons[i].enabled = (i + 1 == Mathf.Clamp(rank, 1, 4));
             }
             if (i < this.trophyIcons.Length && this.trophyIcons[i] != null)
             {
                 this.trophyIcons[i].enabled = (i + 1 == Mathf.Clamp(rank, 1, 4));
             }
         }
     }
 }