コード例 #1
0
    void LearnSkill(int index)
    {
        //remove menu
        fightManager.FightUIManager.HideLearnSkillsMenu();

        //get skill to forget
        SkillModel skillToForget = index < fightManager.currentPlayerPokemon.CurrentSkills.Count ? fightManager.currentPlayerPokemon.CurrentSkills[index] : null;

        //learn skill
        fightManager.currentPlayerPokemon.LearnSkill(fightManager.SkillToLearn, index);

        //if need to forget a skill, show forgetSkillDescription before confirm
        if (skillToForget != null)
        {
            string s = Utility.Parse(forgetSkillDescription, skillToForget.GetObjectName());

            fightManager.FightUIManager.SetDescription(s, ConfirmSkillDescription);
        }
        //else show immediatly the confirm
        else
        {
            ConfirmSkillDescription();
        }
    }