Esempio n. 1
0
        private void UpdateSkillDisplay(Type type)
        {
            TextMeshProUGUI lvlText = null;
            TextMeshProUGUI xpText  = null;

            switch (type)
            {
            case Type.Strength:
                lvlText = StrengthLVLText;
                xpText  = StrengthXPText;
                break;

            case Type.Fitness:
                lvlText = FitnessLVLText;
                xpText  = FitnessXPText;
                break;

            case Type.Intelligence:
                lvlText = PhysicsLVLText;
                xpText  = PhysicsXPText;
                break;

            case Type.Cooking:
                lvlText = CookingLVLText;
                xpText  = CookingXPText;
                break;

            case Type.Charisma:
                lvlText = CharismaLVLText;
                xpText  = CharismaXPText;
                break;

            case Type.Repair:
                lvlText = RepairLVLText;
                xpText  = RepairXPText;
                break;

            case Type.Writing:
            default:
                Debug.LogWarning($"No dedicated text display for skill {type}");
                break;
            }

            if (lvlText != null & xpText != null)
            {
                lvlText.text = (Stats.SkillLevel(type) == 0) ? "-" : Stats.SkillLevel(type).ToString("0");
                xpText.text  = $" XP: {Stats.Skill(type).GetData().xp}/{Stats.Skill(type).GetData().requiredXP}";
            }

            int totalLevel = 0;

            foreach (var skill in Stats.PlayerSkills.Values)
            {
                totalLevel += skill.CurrentLevel;
            }

            TotalLevelText.text = (totalLevel == 0) ? "-" : totalLevel.ToString("0");
        }
Esempio n. 2
0
        private void UpdateSkillDisplay(Type type)
        {
            TextMeshProUGUI lvlText = null;

            switch (type)
            {
            case Type.Strength:
                lvlText = StrengthLVLText;
                break;

            case Type.Fitness:
                lvlText = FitnessLVLText;
                break;

            case Type.Intelligence:
                lvlText = PhysicsLVLText;
                break;

            case Type.Cooking:
                lvlText = CookingLVLText;
                break;

            case Type.Charisma:
                lvlText = CharismaLVLText;
                break;

            case Type.Repair:
                lvlText = RepairLVLText;
                break;

            case Type.Writing:
                lvlText = WritingLVLText;
                break;

            case Type.Mixing:
                lvlText = MixingLVLText;
                break;

            default:
                Debug.LogWarning($"No dedicated text display for skill {type}");
                break;
            }

            if (lvlText != null)
            {
                lvlText.text = (Stats.SkillLevel(type) == 0) ? "-" : Stats.SkillLevel(type).ToString("0");
            }
        }