コード例 #1
0
 public LevelRate(Category cat, int level, float rate)
 {
     this.category = cat;
     this.level = level;
     this.rate = rate;
     this.isIncreasing = 0;
 }
コード例 #2
0
 public void ChangeCategory(Category cat)
 {
     //Panel Items
     List<LevelRate> tempList = this.allAttributes[cat.value];
     if (tempList != null) {
         for (int i = 0; i < tempList.Count; i++) {
             //Panel items
             Transform child = this.transform.GetChild(i);
             PanelItem item = child.GetComponent<PanelItem>();
             if (item != null) {
                 LevelRate levelRate = tempList[i];
                 item.levelText.text = "Level " + levelRate.level.ToString();
                 item.rateText.text = levelRate.rate.ToString();
                 if (levelRate.isIncreasing > 0) {
                     item.isIncreasingText.text = "++";
                 }
                 else if (levelRate.isIncreasing < 0) {
                     item.isIncreasingText.text = "--";
                 }
                 else {
                     item.isIncreasingText.text = "N/A";
                 }
             }
         }
     }
     else {
         Debug.LogError("There's something wrong with the attributes panel UI. Please check.");
     }
 }