Пример #1
0
 /**更新秘宝的基本信息 */
 private void UpdateMagicWeapon()
 {
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon);
     back.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
     icon.SetRect(0f, 0f, 80, 80);
     icon.transform.localPosition = new Vector3(0f, 6f, 1f);
     if (count / 1000000 > 0)
     {
         num.text = "x" + count / 10000 + "W";
     }
     else
     {
         num.text = "x" + count;
     }
 }
Пример #2
0
    public void updateButton(PrizeSample _prize)
    {
        if (stars != null)
        {
            for (int i = 0; i < stars.transform.childCount; i++)
            {
                stars.transform.GetChild(i).gameObject.SetActive(false);
            }
        }
        if (starSoulPoint != null)
        {
            starSoulPoint.SetActive(false);
        }
        Image.alpha     = 1;
        icon_back.alpha = 1;
        prize           = _prize;

        if (_prize.type == PrizeType.PRIZE_CARD)
        {
            Card showCard = CardManagerment.Instance.createCard(_prize.pSid);
            showStar(CardSampleManager.Instance.getRoleSampleBySid(showCard.sid).sFlagLevel);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + showCard.getIconID(), Image);
            Image.width          = (int)iconPic.x;
            Image.height         = (int)iconPic.y;
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(showCard.getQualityId());
            ArrayList list = StorageManagerment.Instance.getNoUseRolesBySid(_prize.pSid);
            scrapSprite.SetActive(false);
            setTextNum(_prize.getPrizeNumByInt());
        }
        else if (_prize.type == PrizeType.PRIZE_EQUIPMENT)
        {
            Equip showEquip = EquipManagerment.Instance.createEquip(_prize.pSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + showEquip.getIconId(), Image);
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(showEquip.getQualityId());
            Image.width          = (int)iconPic.x;
            Image.height         = (int)iconPic.y;
            scrapSprite.SetActive(false);
            setTextNum(_prize.getPrizeNumByInt());
        }
        else if (_prize.type == PrizeType.PRIZE_PROP)
        {
            Prop showProp = PropManagerment.Instance.createProp(_prize.pSid);
            if (showProp.isCardScrap() && stars != null)
            {
                Card card = CardScrapManagerment.Instance.getCardByScrapSid(showProp.sid);//根据卡片碎片id获取对应卡片
                showStar(CardSampleManager.Instance.getRoleSampleBySid(card.sid).sFlagLevel);
            }
            if (showProp.isMagicScrap() && stars != null)
            {
                MagicWeapon magic = MagicWeaponScrapManagerment.Instance.getMagicWeaponByScrapSid(showProp.sid);
                showStar(MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magic.sid).starLevel);
            }
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + showProp.getIconId(), Image);
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(showProp.getQualityId());
            Image.width          = (int)iconPic.x;
            Image.height         = (int)iconPic.y;
            if (showProp.isScrap())
            {
                scrapSprite.SetActive(true);
            }
            else
            {
                scrapSprite.SetActive(false);
            }
            setTextNum(_prize.getPrizeNumByInt());
        }
        else if (_prize.type == PrizeType.PRIZE_MONEY)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.MONEY_ICONPATH, Image);
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(5);
            Image.width          = (int)iconPic.x;
            Image.height         = (int)iconPic.y;
            scrapSprite.SetActive(false);
            setTextNum(_prize.getPrizeNumByInt());
        }
        else if (_prize.type == PrizeType.PRIZE_RMB)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.RMB_ICONPATH, Image);
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(5);
            Image.width          = (int)iconPic.x;
            Image.height         = (int)iconPic.y;
            scrapSprite.SetActive(false);
            setTextNum(_prize.getPrizeNumByInt());
        }
        else if (_prize.type == PrizeType.PRIZE_STARSOUL)
        {
            StarSoul star = StarSoulManager.Instance.createStarSoul(_prize.pSid);
            UpdateStarSoulView(star);
            scrapSprite.SetActive(false);
            setTextNum(_prize.getPrizeNumByInt());
        }
        else if (_prize.type == PrizeType.PRIZE_MAGIC_WEAPON)
        {
            MagicWeapon       magicweapon = MagicWeaponManagerment.Instance.createMagicWeapon(prize.pSid);
            MagicWeaponSample magic       = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(prize.pSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicweapon.getIconId(), Image);
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(magicweapon.getMagicWeaponQuality());
            Image.width          = (int)iconPic.x;
            Image.height         = (int)iconPic.y;
            scrapSprite.SetActive(false);
            setTextNum(_prize.getPrizeNumByInt());
            if (magic != null)
            {
                if (stars != null)
                {
                    showStar(CardSampleManager.USEDBYCARD);
                }
            }
        }
    }
Пример #3
0
    public void updateShower(MagicWeapon magic)
    {
        type = "magic";
        gameObject.SetActive(true);
        //动态加载碰撞器
        Object collider = this.gameObject.GetComponent("BoxCollider");

        if (this.name != "cardmain" && collider == null)
        {
            this.gameObject.AddComponent("BoxCollider");
            this.gameObject.GetComponent <BoxCollider>().isTrigger = true;
            this.gameObject.GetComponent <BoxCollider>().center    = new Vector3(0, 20, -20);
            this.gameObject.GetComponent <BoxCollider>().size      = new Vector3(120, 180, 1);
        }
        magicscrapt = magic;
        cardImage.transform.localScale = new Vector3(1f, 1f, 1f);
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicscrapt.getIconId(), cardImage);

        if (background != null)
        {
            background.gameObject.SetActive(true);
        }
        showLevel.gameObject.SetActive(false);
    }
Пример #4
0
 /**更新秘宝的基本信息 */
 private void UpdateMagicWeapon()
 {
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon);
     quality = magicWeapon.getMagicWeaponQuality();
     //backGround.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
     icon.SetRect(0f, 0f, 105, 105f);
     icon.transform.localPosition = new Vector3(0f, 6f, 1f);
     setCountActive(count > 0);
     if (count / 1000000 > 0)
     {
         rightBottomText.text = "x" + count / 10000 + "W";
     }
     else
     {
         rightBottomText.text = "x" + count;
     }
 }
Пример #5
0
 /// <summary>
 /// 更新拥有形象(强化等级,进阶等级,形象,形象背景)
 /// </summary>
 private void updateCommonInfo()
 {
     if (magicWeapon.getStrengLv() >= magicWeapon.getMaxStrengLv())
     {
         strengButton.disableButton(false);
         maxObj.SetActive(true);
         needProObj.SetActive(false);
     }
     else
     {
         maxObj.SetActive(false);
         needProObj.SetActive(true);
     }
     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();
     updateProp();
 }
Пример #6
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();
 }
Пример #7
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);
            }
        }
    }
Пример #8
0
    /**更新秘宝的基本信息 */
    private void UpdateMagicWeapon()
    {
        showName = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName();
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon);
        backGround.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality());
        icon.SetRect(0f, 0f, 105, 105f);
        icon.transform.localPosition = new Vector3(0f, 6f, 1f);
        setCountActive(count > 0);
        if (count / 1000000 > 0)
        {
            rightBottomText.text = "x" + count / 10000 + "W";
        }
        else
        {
            rightBottomText.text = "x" + count;
        }
        rightBottomText.text = "";
        int level = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel;

        showStar(level, CardSampleManager.USEDBYCARD);
    }