Beispiel #1
0
        /// <summary>
        /// 设置全部的技能信息
        /// </summary>
        private void SetAllSkillInfo()
        {
            InitSkillObjs();
            bool active = currentUIToggel == zdSkill;

            if (active)
            {
                NGUITools.FindChild(bdSkill.gameObject, "tips").SetActive(Singleton <SkillMode> .Instance.IfShowTips(false));
                NGUITools.FindChild(zdSkill.gameObject, "tips").SetActive(false);
            }
            else
            {
                NGUITools.FindChild(zdSkill.gameObject, "tips").SetActive(Singleton <SkillMode> .Instance.IfShowTips(true));
                NGUITools.FindChild(bdSkill.gameObject, "tips").SetActive(false);
            }

            List <SysSkillBaseVo> skills = Singleton <SkillMode> .Instance.CurrentSkills(active);

            for (int i = 0; i < skills.Count; i++)
            {
                SysSkillBaseVo skill = skills[i];
                if (skills[i] != null)
                {
                    GameObject skillObj = skillList[i];
                    skillObj.name = skill.id.ToString();
                    SkillState state = SkillViewLogic.GetSkillState(skill);
                    NGUITools.FindInChild <UISprite>(skillObj, "icon").spriteName = skill.icon.ToString();
                    if (state == SkillState.Learn) //学习状态-置灰
                    {
                        UIUtils.ChangeGrayShader(NGUITools.FindInChild <UISprite>(skillObj, "icon"), 23);
                    }
                    else
                    {
                        NGUITools.FindChild(skillObj, "lvl").SetActive(true);
                        NGUITools.FindInChild <UILabel>(skillObj, "lvl").text = "Lv." + skill.skill_lvl;
                        UIUtils.ChangeNormalShader(NGUITools.FindInChild <UISprite>(skillObj, "icon"), 22);
                    }
                    if (state != SkillState.Max)
                    {
                        SysSkillBaseVo nextSkill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)skill.next);
                        if (SkillViewLogic.IsConditionEnough(nextSkill))
                        {
                            NGUITools.FindChild(skillObj, "tips").SetActive(true);
                        }
                    }
                    if (currentSkill != null && currentSkill.position == skills[i].position && currentSkill.group == skills[i].group)
                    {
                        OnSkillClick(skillObj);
                    }
                }
            }
            if (currentSkill == null)
            {
                OnSkillClick(skillList[0]);
            }
            SetSkillsPosInfo();
            SetGuideButton();
            CheckGuide();
        }
Beispiel #2
0
        public bool IfShowTips(bool active)
        {
            List <SysSkillBaseVo> skills = CurrentSkills(active);

            foreach (SysSkillBaseVo skill in skills)
            {
                if (skill != null && skill.next != 0)
                {
                    SysSkillBaseVo nextSkill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)skill.next);

                    if (SkillViewLogic.IsConditionEnough(nextSkill))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #3
0
        private void SetSkillInfo(SysSkillBaseVo skill)
        {
            NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/skillname").text   = skill.name;
            NGUITools.FindInChild <UISprite>(gameObject, "skillinfo/icon").spriteName = skill.icon.ToString();

            SkillState state = SkillViewLogic.GetSkillState(skill);

            NGUITools.FindChild(gameObject, "skillinfo/1").SetActive(true);
            if (state == SkillState.Max) //满级
            {
                NGUITools.FindChild(gameObject, "skillinfo/2").SetActive(false);
                UpgradeButton.SetActive(true);

                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/lvl").text  = "当前等级:" + skill.skill_lvl + " (满级)";
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/lvl").color = ColorConst.FONT_YELLOW;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/time").text = "冷却时间:" + skill.cd / 1000 + "s";
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/cost").text = "魔法消耗:" + skill.need_value;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/des").text  = "技能说明:" + skill.desc;
            }
            else if (state == SkillState.Learn) //学习
            {
                skill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)skill.next);
                NGUITools.FindChild(gameObject, "skillinfo/2").SetActive(false);
                UpgradeButton.SetActive(true);
                UpgradeButton.FindInChild <UILabel>("needvalue").text = skill.point.ToString();
                UpgradeButton.FindInChild <UILabel>("label").text     = "学  习";
                UpgradeButton.FindInChild <UILabel>("leftvalue").text = Singleton <SkillMode> .Instance.LeftPoint().ToString();

                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/lvl").text  = "当前等级:" + skill.skill_lvl + " (未学习)";
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/lvl").color = ColorConst.FONT_WHITE;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/time").text = "冷却时间:" + (float)skill.cd / 1000 + "s";
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/cost").text = "魔法消耗:" + skill.need_value;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/des").text  = "技能说明:" + skill.desc;

                if (skill.point > Singleton <SkillMode> .Instance.LeftPoint())
                {
                    UpgradeButton.FindInChild <UILabel>("needvalue").color = ColorConst.FONT_RED;
                }
                else
                {
                    UpgradeButton.FindInChild <UILabel>("needvalue").color = ColorConst.FONT_YELLOW;
                }
            }
            else if (state == SkillState.Upgrade)//升级
            {
                NGUITools.FindChild(gameObject, "skillinfo/2").SetActive(true);
                UpgradeButton.SetActive(true);

                SysSkillBaseVo nextSkill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)skill.next);

                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/lvl").text  = "当前等级:" + skill.skill_lvl;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/lvl").color = ColorConst.FONT_YELLOW;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/time").text = "冷却时间:" + (float)skill.cd / 1000 + "s";
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/cost").text = "魔法消耗:" + skill.need_value;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/1/des").text  = "技能说明:" + skill.desc;

                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/2/lvl").text  = "下一等级:" + nextSkill.skill_lvl;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/2/time").text = "冷却时间:" + (float)nextSkill.cd / 1000 + "s";
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/2/cost").text = "魔法消耗:" + nextSkill.need_value;
                NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/2/des").text  = "技能说明:" + nextSkill.desc;

                if (SkillViewLogic.IsConditionEnough(nextSkill))
                {
                    NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/2/lvl").color = ColorConst.FONT_YELLOW;
                }
                else
                {
                    NGUITools.FindInChild <UILabel>(gameObject, "skillinfo/2/lvl").color = ColorConst.FONT_RED;
                }
                UpgradeButton.FindInChild <UILabel>("label").text     = "升  级";
                UpgradeButton.FindInChild <UILabel>("needvalue").text = nextSkill.point.ToString();
                UpgradeButton.FindInChild <UILabel>("leftvalue").text = Singleton <SkillMode> .Instance.LeftPoint().ToString();

                if (skill.point > Singleton <SkillMode> .Instance.LeftPoint())
                {
                    UpgradeButton.FindInChild <UILabel>("needvalue").color = ColorConst.FONT_RED;
                }
                else
                {
                    UpgradeButton.FindInChild <UILabel>("needvalue").color = ColorConst.FONT_YELLOW;
                }
            }
            NGUITools.FindChild(gameObject, "skillinfo/2/time").SetActive(skill.active);
            NGUITools.FindChild(gameObject, "skillinfo/2/cost").SetActive(skill.active);
            NGUITools.FindChild(gameObject, "skillinfo/1/time").SetActive(skill.active);
            NGUITools.FindChild(gameObject, "skillinfo/1/cost").SetActive(skill.active);
        }