コード例 #1
0
        public void skillLevelDown(GameObject skillObject)
        {
            string  skillName = skillObject.name;
            A_Skill skill     = skillTree.Find(x => x.skillName == skillName);

            if (skill.skillLevel - 1 >= 0 && skill.isLearned == true)
            {
                if (skill.skillLevel - 1 >= 1)
                {
                    --skill.skillLevel;
                    // skill init as level X

                    ++HeroController.mainHero.freeSkillPoints;
                    skillToolTip.setToolTipGeneratedValue(false);
                    skillToolTip.generateToolTip(skill, "LoadPreviousLevel");
                    refreshSkillLevelText(skillObject, skillName, skill);
                }
                else if (skill.skillLevel - 1 == 0 && !skill.skillName.Equals("Rearm")) // Rearm is starting point for skills learning
                {
                    HeroSkillsController.setSkillAsNotLearned(skill);
                    HeroSkillsController.cascadeSkillRemoval(skillTree, skill);
                    initializeSkills(skillTrees); // Need to refresh all skills
                }
                //cmController.getSkillPoints();    //display skillpoints
            }
        }
コード例 #2
0
        public void skillLevelDown(GameObject _skill)
        {
            string  _sName = _skill.name;
            A_Skill _s     = skillTree.Find(x => x.skillName == _sName);

            if (_s.skillLevel - 1 >= 0 && _s.isLearned == true)
            {
                if (_s.skillLevel - 1 >= 1)
                {
                    --_s.skillLevel;
                    refreshSkill(_skill, _sName, _s);
                    ++HeroController.mainHero.freeSkillPoints;
                    visualValuesUpdated = false;
                }
                else if (_s.skillLevel - 1 == 0 && !_s.skillName.Equals("Rearm")) // Rearm is starting point for skills learning
                {
                    HeroSkillsController.setSkillAsNotLearned(_s);
                    HeroSkillsController.cascadeSkillRemoval(skillTree, _s);
                    loadSkillLevels(skillTreeParent); // Need to refresh all skills
                    visualValuesUpdated = false;
                }
            }
        }