Ejemplo n.º 1
0
 /// <summary>
 /// 更新拥有形象(强化等级,进阶等级,形象,形象背景)
 /// </summary>
 private void updateCommonInfo()
 {
     if (magicWeapon.getPhaseLv() > 0)
     {
         phaseLv.gameObject.SetActive(true);
         phaseLv.text = "+" + magicWeapon.getPhaseLv().ToString();
     }
     else
     {
         phaseLv.gameObject.SetActive(false);
     }
     magicName.text = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName();
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon);
     strengLv.text      = "Lv." + magicWeapon.getStrengLv().ToString() + "/" + magicWeapon.getMaxStrengLv().ToString();
     icon_bg.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
     if (starPrefab != null)
     {
         Utils.RemoveAllChild(icon.transform);
         int starLevel = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel;
         if (starLevel > 0)
         {
             ShowStars show = NGUITools.AddChild(icon.gameObject, starPrefab).GetComponent <ShowStars>();
             show.initStar(starLevel, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW);
         }
     }
     jobType.gameObject.SetActive(true);
     jobBg.gameObject.SetActive(true);
     if (magicWeapon.getMgType() == JobType.POWER)  //力
     {
         jobType.spriteName = "roleType_2s";
     }
     else if (magicWeapon.getMgType() == JobType.MAGIC)    //魔
     {
         jobType.spriteName = "roleType_5s";
     }
     else if (magicWeapon.getMgType() == JobType.AGILE)    //敏
     {
         jobType.spriteName = "roleType_3s";
     }
     else if (magicWeapon.getMgType() == JobType.POISON)    //毒
     {
         jobType.spriteName = "roleType_4s";
     }
     else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK)    //反
     {
         jobType.spriteName = "roleType_1s";
     }
     else if (magicWeapon.getMgType() == JobType.ASSIST)    //辅
     {
         jobType.spriteName = "roleType_6s";
     }
     else
     {
         jobType.gameObject.SetActive(false);
         jobBg.gameObject.SetActive(false);
     }
     updateAttrChanges();
     updateSkills();
 }
Ejemplo n.º 2
0
    //拿到指定类型的秘宝 还需要排除掉需要替换的
    public ArrayList getAllMagicWeaponByType(int type, string uid)
    {
        ArrayList magicList = magicWeaponStorage.getStorageProp();

        if (magicList == null || magicList.Count < 1)
        {
            return(null);
        }
        ArrayList mwlist = null;

        for (int i = 0; i < magicList.Count; i++)
        {
            MagicWeapon mw = magicList[i] as MagicWeapon;
            if (mw.uid != uid && mw.state != 1 && (mw.getMgType() == type || mw.getMgType() == 0))
            {
                if (mwlist == null)
                {
                    mwlist = new ArrayList();
                }
                mwlist.Add(mw);
            }
        }
        return(mwlist);
    }
Ejemplo n.º 3
0
    public bool checkHaveCommendMagicWeapon()
    {
        ArrayList mwList = getallResolveMagicWeapon();

        if (mwList == null || mwList.Count <= 0)
        {
            return(false);
        }
        for (int i = 0; i < mwList.Count; i++)
        {
            MagicWeapon mw = mwList[i] as MagicWeapon;
            if (mw.getMgType() == 0)
            {
                return(true);
            }
        }
        return(false);
    }
Ejemplo n.º 4
0
    void updateUI()
    {
        fawin.updateCanGetMagicWeaponCount();
        numLabel.text = "[6A4D36]" + LanguageConfigManager.Instance.getLanguage("store03") + "[-]" + MagicWeaponScrapManagerment.Instance.getNumString(magicExSamle);
        thisProp      = MagicWeaponScrapManagerment.Instance.getNeedProp(magicExSamle);
        havePropNum   = StorageManagerment.Instance.getProp(thisProp.sid) == null ? 0 : StorageManagerment.Instance.getProp(thisProp.sid).getNum();
        if (havePropNum == 0)
        {
            buttonDecompostion.disableButton(true);
        }
        //按钮显示判断
        int count = ExchangeManagerment.Instance.getCanExchangeNum(exchange);

        if (count <= 0)
        {
            buttonExchange.disableButton(true);
        }
        else
        {
            buttonExchange.disableButton(false);
        }
        buttonExchange.fatherWindow = fawin;
        buttonExchange.updateButton(exchange);
        //初始化分解按键
        buttonDecompostion.fatherWindow = fawin;
        buttonDecompostion.onClickEvent = beginDecomposion;
        //显示装备
        if (magicExSamle.exType == 8)
        {
            MagicWeapon nw = MagicWeaponManagerment.Instance.createMagicWeapon(magicExSamle.exchangeSid);
            magicW = nw;
            //更新神器职业背景颜色,用以区分品质
            typeQuality.spriteName = QualityManagerment.qualityIconBgToBackGround(magicW.getMagicWeaponQuality());
            //显示职业
            typeIcon.gameObject.SetActive(true);
            typeQuality.gameObject.SetActive(true);
            if (magicW.getMgType() == JobType.POWER)  //力
            {
                typeIcon.spriteName = "roleType_2";
            }
            else if (magicW.getMgType() == JobType.MAGIC)    //魔
            {
                typeIcon.spriteName = "roleType_5";
            }
            else if (magicW.getMgType() == JobType.AGILE)    //敏
            {
                typeIcon.spriteName = "roleType_3";
            }
            else if (magicW.getMgType() == JobType.POISON)    //毒
            {
                typeIcon.spriteName = "roleType_4";
            }
            else if (magicW.getMgType() == JobType.COUNTER_ATTACK)    //反
            {
                typeIcon.spriteName = "roleType_1";
            }
            else if (magicW.getMgType() == JobType.ASSIST)    //辅
            {
                typeIcon.spriteName = "roleType_6";
            }
            else
            {
                typeIcon.gameObject.SetActive(false);
                typeQuality.gameObject.SetActive(false);
            }
            nameLabel.text = QualityManagerment.getQualityColor(nw.getMagicWeaponQuality()) + nw.getName();
            if (button == null)
            {
                item      = NGUITools.AddChild(gameObject, goodsViewPrefab);
                item.name = "goodsView";
                button    = item.GetComponent <GoodsView>();
                button.onClickCallback = showMagicWeapon;
            }
            if (button != null && nw != null)
            {
                button.init(nw);
                button.fatherWindow         = fawin;
                button.rightBottomText.text = "";
            }
        }
    }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新拥有形象(强化等级,进阶等级,形象,形象背景)
 /// </summary>
 private void updateCommonInfo()
 {
     if (magicWeapon.getPhaseLv() > 0)
     {
         phaseLv.gameObject.SetActive(true);
         phaseLv.text = "+" + magicWeapon.getPhaseLv().ToString();
     }
     else
     {
         phaseLv.gameObject.SetActive(false);
     }
     towerBar.updateValue((float)magicWeapon.getLuckNumber(), (float)100);
     towerValue.text = magicWeapon.getLuckNumber() + "%";
     magicName.text  = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName();
     phaseNum.text   = magicWeapon.getPhaseLv() + "/" + magicWeapon.getMaxPhaseLv();
     phaseButton.disableButton(false);
     if (magicWeapon.getPhaseLv() == magicWeapon.getMaxPhaseLv())
     {
         phaseNum.text = LanguageConfigManager.Instance.getLanguage("magicweapLiii03");
         //phaseButton.disableButton(true);
     }
     updateSuccess();
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon);
     icon_bg.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
     if (starPrefab != null)
     {
         Utils.RemoveAllChild(icon.transform);
         int starLevel = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel;
         if (starLevel > 0)
         {
             ShowStars show = NGUITools.AddChild(icon.gameObject, starPrefab).GetComponent <ShowStars>();
             show.initStar(starLevel, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW);
         }
     }
     //职业显示
     jobType.gameObject.SetActive(true);
     jobBg.gameObject.SetActive(true);
     if (magicWeapon.getMgType() == JobType.POWER)  //力
     {
         jobType.spriteName = "roleType_2s";
     }
     else if (magicWeapon.getMgType() == JobType.MAGIC)    //魔
     {
         jobType.spriteName = "roleType_5s";
     }
     else if (magicWeapon.getMgType() == JobType.AGILE)    //敏
     {
         jobType.spriteName = "roleType_3s";
     }
     else if (magicWeapon.getMgType() == JobType.POISON)    //毒
     {
         jobType.spriteName = "roleType_4s";
     }
     else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK)    //反
     {
         jobType.spriteName = "roleType_1s";
     }
     else if (magicWeapon.getMgType() == JobType.ASSIST)    //辅
     {
         jobType.spriteName = "roleType_6s";
     }
     else
     {
         jobType.gameObject.SetActive(false);
         jobBg.gameObject.SetActive(false);
     }
     updateSkills();
     updateProp();
 }
Ejemplo n.º 6
0
    public void UpdateMagicWeapon(MagicWeapon mWeapon, int type)
    {
        magicWeapon = mWeapon;
        intoType    = type;
        if (intoType == MagicWeaponType.FROM_CARD_BOOK_NOT_M)
        {
            //没有秘宝的情况敢进入单独仓库界面 是想上装的节奏
            if (magicWeapon.state == MagicWeaponType.ON_USED)
            {
                putonButton.gameObject.SetActive(false);
            }
            else
            {
                putonButton.gameObject.SetActive(true);
                putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0013");
                putonButton.onClickEvent   = putOnMagicWeapon;
            }
        }
        else if (intoType == MagicWeaponType.STRENG)
        {
            putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0012");
            putonButton.onClickEvent   = gotoStrengWindow;          //进入强化界面
        }
        else if (intoType == MagicWeaponType.FROM_CARD_BOOK_HAVE_M) //替换
        {
            putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0036");
            putonButton.onClickEvent   = gotoReplareWindow;
        }
        iconButton.onClickEvent = gotoStrengWindowformIcon;

        //更新秘宝的强化等级
        if (magicWeapon.getPhaseLv() > 0)  //更新秘宝的进阶等级
        {
            starLevel.gameObject.SetActive(true);
            starLevel.text = "+" + magicWeapon.getPhaseLv().ToString();
        }
        else
        {
            starLevel.gameObject.SetActive(false);
        }
        //更新秘宝的名字、图片、强化等级、状态、是否是新装备、职业类型
        typeIcon.gameObject.SetActive(true);
        typeQuality.gameObject.SetActive(true);
        if (magicWeapon.getMgType() == JobType.POWER)  //力
        {
            typeIcon.spriteName = "roleType_2";
        }
        else if (magicWeapon.getMgType() == JobType.MAGIC)    //魔
        {
            typeIcon.spriteName = "roleType_5";
        }
        else if (magicWeapon.getMgType() == JobType.AGILE)    //敏
        {
            typeIcon.spriteName = "roleType_3";
        }
        else if (magicWeapon.getMgType() == JobType.POISON)    //毒
        {
            typeIcon.spriteName = "roleType_4";
        }
        else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK)    //反
        {
            typeIcon.spriteName = "roleType_1";
        }
        else if (magicWeapon.getMgType() == JobType.ASSIST)    //辅
        {
            typeIcon.spriteName = "roleType_6";
        }
        else
        {
            typeIcon.gameObject.SetActive(false);
            typeQuality.gameObject.SetActive(false);
        }
        //更新神器职业背景颜色,用以区分品质
        typeQuality.spriteName = QualityManagerment.qualityIconBgToBackGround(magicWeapon.getMagicWeaponQuality());
        mwname.text            = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName();
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), itemIcon);
        stengLv.text = "Lv." + magicWeapon.getStrengLv().ToString();
        if (magicWeapon.state == 1)
        {
            state.text = LanguageConfigManager.Instance.getLanguage("s0017");
        }
        else
        {
            state.text = "";
        }
        if (magicWeapon.getIsNew())
        {
            if (isNew != null && !isNew.gameObject.activeSelf)
            {
                isNew.gameObject.SetActive(true);
            }
        }
        else if (isNew != null && isNew.gameObject.activeSelf)
        {
            isNew.gameObject.SetActive(false);
        }
        //更新秘宝图片的背景 用品质来区分
        quality.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
        //更新秘宝的属性
        AttrChange[] attrs = magicWeapon.getAttrChanges();
        for (int j = 0; j < equipAttributeValue.Length; j++)  //所有属性全清零
        {
            equipAttribute[j].text      = "";
            equipAttributeValue[j].text = "";
        }
        if (attrs != null && attrs.Length > 0 && attrs[0] != null)
        {
            for (int i = 0; i < attrs.Length; i++)
            {
                equipAttribute[i].text = attrs[i].typeToString();
                if (equipAttributeValue[i] != null)
                {
                    equipAttributeValue[i].text = attrs[i].num + "";
                }
            }
        }
        if (magicWeapon != null && starPrefab != null)
        {
            Utils.RemoveAllChild(itemIcon.transform);
            int level = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel;
            if (level > 0)
            {
                GameObject obj  = NGUITools.AddChild(itemIcon.gameObject, starPrefab);
                ShowStars  show = obj.GetComponent <ShowStars>();
                show.initStar(level, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW);
            }
        }
    }