示例#1
0
    //public void UnloadSchedule(ScheduleSlot vv)
    //{
    //    vv.Content.text = "死宅";
    //    rmgr.ChangeSchedule(view.slots.IndexOf(vv),null);

    //    view.DespHint.gameObject.SetActive(false);
    //    SelectSchedule(null);
    //}
    public void PracticeSkill()
    {
        if (selectedSkillId == "")
        {
            return;
        }
        string    skillId = selectedSkillId;
        SkillInfo skill   = pSkillMgr.GetOwnedSkill(skillId);

        if (skill == null)
        {
            return;
        }
        if (skill.SkillLvl == pSkillMgr.GetSkillAsset(skillId).MaxLevel)
        {
            return;
        }
        if ((skill.sa as BaseSkillAsset) != null)
        {
            return;
        }

        if (!rmgr.CanPractice())
        {
            return;
        }

        rmgr.Practive();
        pSkillMgr.GainExp(skillId);
        lockLearnButton = true;

        view.ExpSlider.DOValue(skill.NowExp * 0.01f, 0.3f).OnComplete(delegate
        {
            lockLearnButton = false;
            ShowDetail(skillId);
        }
                                                                      );

        UpdateActionCost();
    }
示例#2
0
    //public void UnloadSchedule(ScheduleSlot vv)
    //{
    //    vv.Content.text = "死宅";
    //    rmgr.ChangeSchedule(view.slots.IndexOf(vv),null);

    //    view.DespHint.gameObject.SetActive(false);
    //    SelectSchedule(null);
    //}

    public void LearnCurSkill()
    {
        if (selectedSkill == -1 || selectedSkill >= model.NowSkills.Count)
        {
            return;
        }
        string    skillId = model.NowSkills[selectedSkill];
        SkillInfo skill   = pSkillMgr.GetOwnedSkill(skillId);

        if (skill == null)
        {
            Debug.Log("learn");
            pSkillMgr.GainSkills(model.NowSkills[selectedSkill]);
            view.BeforeStudyPanel.gameObject.SetActive(false);
            view.AfterStudyPanel.gameObject.SetActive(true);

            UpdateExp(pSkillMgr.GetOwnedSkill(skillId));
        }
        else
        {
            if (skill.SkillLvl == pSkillMgr.GetSkillAsset(skillId).MaxLevel)
            {
                return;
            }
            if (!rmgr.CanPractice())
            {
                return;
            }
            rmgr.Practive();
            pSkillMgr.GainExp(skillId);
            lockLearnButton = true;

            view.ExpSlider.DOValue(skill.NowExp * 0.01f, 0.3f).OnComplete(delegate
            {
                lockLearnButton = false;
                UpdateExp(skill);
            }
                                                                          );
        }
    }