コード例 #1
0
    void Start()
    {
        m_pRootLayout = GameObject.Find(NBUiHelper.NB_UI_MEDAL_UP_COMPLETE);
        NGUITools.AddChild(NBUiHelper.BaseLayer, m_pRootLayout);

        NBHero pCurrentHero = NBGameWorld.SharedInstance().GetMe().GetCurrentHero();

        m_pOld.Init(pCurrentHero.GetCharacterId());
        m_pNew.Init(pCurrentHero.GetCharacterId());

        m_pNew.SetExp(pCurrentHero.GetExp());
        m_pNew.SetQuality(pCurrentHero.GetQuality());
        m_pNew.SetStar(pCurrentHero.GetStar());
        m_pNew.SetPhaseLevel(pCurrentHero.GetPhaseLevel());

        m_pOld.SetExp(pCurrentHero.GetExp());
        m_pOld.SetQuality(pCurrentHero.GetQuality());
        m_pOld.SetStar(pCurrentHero.GetStar());
        m_pOld.SetPhaseLevel(pCurrentHero.GetPhaseLevel() - 1);

        m_pNew.calcAttr();
        m_pOld.calcAttr();

        if (!InitSkill())
        {
            return(false);
        }

        Initleft();
        Initright();

        return(true);
    }
コード例 #2
0
    public bool InitSkill()
    {
        int nextphaselevel = m_pNew.GetPhaseLevel();

        if (nextphaselevel == 0)
        {
            return(false);
        }
        NBMedalEvolutionConfInfo pNextMedalEv = NBGameConfig.SharedConfig().GetMedalEvolutionConfInfo(NBUiHelper.Make_pair(m_pNew.GetClassID(), nextphaselevel));

        if (pNextMedalEv == null)
        {
            return(false);
        }
        string skillID = "";
        //待解锁的技能图片id
        string skilliconid = "";
        //待解锁的技能名字
        string nowSkillName  = "";
        string descSkillName = "";
        //待解锁的条件
        string skillcond;
        string rowstr = "\n";
        NBCharacterConfInfo pCharacterConfInfo = NBGameConfig.SharedConfig().GetCharacterConfInfo(m_pNew.GetCharacterId());

        if (pCharacterConfInfo == null)
        {
            return(false);
        }
        NBParameterConfInfo pParam = NBGameConfig.SharedConfig().GetParameterConfInfo();

        if (pNextMedalEv != null)
        {
            skillcond = string.Format(NBStringResource.GetText("medal_skillcond") + pNextMedalEv.phaselname);
        }

        //改变进阶顺序
        //2.1   1.5  5.2
        if (nextphaselevel == 1)
        {
            skillID       = pCharacterConfInfo.autoSkill1Id;
            skilliconid   = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill1Id).skillIconId;
            nowSkillName  = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill1Id).skillName;
            descSkillName = nowSkillName;
        }
        else if (nextphaselevel == 2)
        {
            skillID       = pCharacterConfInfo.autoSkill2Id;
            skilliconid   = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill2Id).skillIconId;
            nowSkillName  = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill2Id).skillName;
            descSkillName = nowSkillName;
        }
        else if (nextphaselevel == 3)
        {
            skillID       = pCharacterConfInfo.autoSkill1Id;
            skilliconid   = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill1Id).skillIconId;
            nowSkillName  = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill1Id).skillName;
            descSkillName = nowSkillName;
        }
        else if (nextphaselevel == 4)
        {
            skillID       = pCharacterConfInfo.autoSkill2Id;
            skilliconid   = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill2Id).skillIconId;
            nowSkillName  = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.autoSkill2Id).skillName;
            descSkillName = nowSkillName;
        }
        else if (nextphaselevel == 5)
        {
            skillID       = pCharacterConfInfo.activeSkillId;
            skilliconid   = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.activeSkillId).skillIconId;
            nowSkillName  = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.activeSkillId).skillName;
            descSkillName = nowSkillName;
        }
        else if (nextphaselevel == 6)
        {
            skillID       = pCharacterConfInfo.passiveSkillId;
            skilliconid   = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.passiveSkillId).skillIconId;
            nowSkillName  = NBGameConfig.SharedConfig().GetSkillConfInfo(pCharacterConfInfo.passiveSkillId).skillName;
            descSkillName = nowSkillName;
        }
        else if (nextphaselevel == 7)
        {
        }
        string finaldesc;
        string strconfphasex = string.Format("medal_phase{0}", nextphaselevel - 1);
        string strupdesc     = string.Format("{0}", NBStringResource.GetText(strconfphasex));

        finaldesc = strupdesc + descSkillName;

        string skillname   = nowSkillName;
        string desCription = NBStringResource.GetText("unlock_skill") + finaldesc;

        NBResConfInfo p_resInfo        = NBGameConfig.SharedConfig().GetResConfInfo(skilliconid);
        UIButton      skillBtn         = m_pRootLayout.transform.FindChild("Button_skill").gameObject.GetComponent <UIButton>();
        string        EquipHeadFrame   = string.Format("{0}", NBUiHelper.NB_UI_HEAD_NO_FOUND_ICON);
        string        EquipBorderFrame = string.Format("{0}", NBUiHelper.NB_UI_BORDER_NO_FOUND_ICON);

        if (p_resInfo != null)
        {
            EquipHeadFrame = string.Format("{0}", p_resInfo.headRes);
        }
        UISprite imageView_item      = skillBtn.transform.FindChild("ImageView_backitem").gameObject.GetComponent <UISprite>();
        UISprite imageView_itemfront = skillBtn.transform.FindChild("ImageView_frontitem").gameObject.GetComponent <UISprite>();

        imageView_item.GetComponent <UISprite>().spriteName      = EquipHeadFrame;
        imageView_itemfront.GetComponent <UISprite>().spriteName = EquipBorderFrame;

        UILabel pSkillNewLbl = m_pRootLayout.transform.FindChild("Label_skill").gameObject.GetComponent <UILabel>();

        pSkillNewLbl.text = desCription;
        if (skillID == "")
        {
            return(true);
        }
        NBSkill pSkill       = m_pNew.GetSkill(skillID);
        UILabel pSkillDesLbl = m_pRootLayout.transform.FindChild("Label_des").gameObject.GetComponent <UILabel>();

        pSkillDesLbl.text = pSkill.GetSkillConfInfo().tips;
        UILabel pSkillDesLbl1 = m_pRootLayout.transform.FindChild("Label_des1").gameObject.GetComponent <UILabel>();
        string  propTextStr   = NBSkillTips.Calc(skillID, pSkill.GetSkillLevel(), m_pNew);

        pSkillDesLbl1.text = propTextStr;
        return(true);
    }