示例#1
0
        private void OnUpgradeClick(GameObject obj)
        {
            if (currentSkill != null)
            {
                if (currentSkill.next != 0)
                {
                    SysSkillBaseVo nextSkill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)currentSkill.next);
                    if (!SkillViewLogic.IsLevelEnough(nextSkill))
                    {
                        MessageManager.Show("角色等级不足,请升级主角等级到" + nextSkill.lvl + "级!");
                    }
                    else

                    if (!SkillViewLogic.IsSkillPointEnough(nextSkill))
                    {
                        MessageManager.Show("灵魂点不足!");
                    }
                    else if (!SkillViewLogic.IsPreSkillEnough(nextSkill))
                    {
                        SysSkillBaseVo preSkill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)nextSkill.pre);
                        MessageManager.Show("请先学习技能 " + preSkill.name + " 到 " + preSkill.skill_lvl + " 级");
                    }
                    else
                    {
                        Singleton <SkillControl> .Instance.LearnSkill((uint)currentSkill.id);
                    }
                }
                else
                {
                    MessageManager.Show("当前技能已经满级");
                }
            }
        }
示例#2
0
        public void SetSkillDetailInfo(SysSkillBaseVo svo)
        {
            if (gameObject != null)
            {
                SkillVo = svo;
                SysSkillBaseVo skillVo = SkillVo;
                SkillState     state   = SkillViewLogic.GetSkillState(skillVo);

                //当前技能不是学习状态则已经激活
                bool enable = state != SkillState.Learn;

                //技能-升级或者进阶
                bool showUpgrade = (state != SkillState.Change);

                bool showChange = (state == SkillState.Change);
                //满级
                bool limit = (skillVo.next == 0);

                //获取下一级信息
                uint nextId = (uint)skillVo.next;
                if (nextId == 0)
                {
                    //下一级技能为进阶技能
                    nextId = (uint)skillVo.evolve;
                }

                SysSkillBaseVo nextSkill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>(nextId);

                //当前技能为0级,则显示1级技能信息
                if (!enable && nextSkill != null)
                {
                    skillVo = nextSkill;
                }

                string skillType;

                if (skillVo.active)
                {
                    skillType = LanguageManager.GetWord("SkillTipsView.TypeZD");
                    if (skillVo.group)
                    {
                        skillType += LanguageManager.GetWord("SkillTipsView.Group");
                    }
                    else
                    {
                        skillType += LanguageManager.GetWord("SkillTipsView.Single");
                    }
                }
                else
                {
                    skillType = LanguageManager.GetWord("SkillTipsView.TypeBD");
                }

                //当前技能的信息
                string icn = skillVo.icon.ToString();
                if (!SkillViewLogic.IsLevelEnough(skillVo))
                {
                    icn = "suo";
                }
                setSkillIcn(icn);
                setSkillEnable(enable);
                setSkillTitle(skillVo.name, skillVo.skill_lvl.ToString(), limit);
                setSkillInfo(skillType, skillVo.cover_width, skillVo.need_value, skillVo.cd / 1000f, skillVo.desc);

                //升级的信息
                if (nextId != 0)
                {
                    //升级相关的信息
                    bool levelEnough = SkillViewLogic.IsLevelEnough(nextSkill);
                    bool moneyEnough = SkillViewLogic.IsMoneyEnough(nextSkill);
                    bool pointEnough = SkillViewLogic.IsSkillPointEnough(nextSkill);

                    string preskill       = null;
                    bool   preSkillEnough = true;

                    if (skillVo.pre != 0)
                    {
                        SysSkillBaseVo pSkill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)skillVo.pre);
                        if (pSkill.skill_lvl != 0)
                        {
                            preskill       = pSkill.name;
                            preSkillEnough = SkillViewLogic.IsPreSkillEnough(nextSkill);
                        }
                    }

                    setSkillCondition(nextSkill.lvl, nextSkill.point, nextSkill.beiley, preskill, levelEnough, pointEnough,
                                      moneyEnough, preSkillEnough);
                    setNextSkillTitle(nextSkill.name, nextSkill.skill_lvl, nextSkill.desc);
                    condition.SetActive(true);
                    skillButton.SetActive(true);
                }
                else
                {
                    condition.SetActive(false);
                    skillButton.SetActive(false);
                }
            }
        }