SinglePlayer.UI.LevelRateHandler.ChangeCategory C# (CSharp) Метод

ChangeCategory() публичный Метод

public ChangeCategory ( Category cat ) : void
cat Category
Результат void
        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.");
            }
        }