Exemplo n.º 1
0
    /** 初始化秘宝 */
    public void initMagicWeaponButton(GameObject gameObj, MagicWeapon magicWeap, int index)
    {
        GameObject obj = NGUITools.AddChild(gameObj, goodsViewPrefab);

        obj.transform.localScale = new Vector3(1.4f, 1.4f, 1);
        GoodsView goods = obj.GetComponent <GoodsView>();

        goods.fatherWindow = this;
        goods.linkQualityEffectPoint();
        goods.init(magicWeap);
        goods.onClickCallback = goods.DefaultClickEvent;
        //goods.onClickCallback = () => {
        //    TweenAlpha lname = TweenAlpha.Begin(gameObject, 1f, 0);
        //    lname.from = 1;
        //    UiManager.Instance.openWindow<MagicWeaponStrengWindow>((win) => {
        //        win.Initialize(magicWeap, EquipAttrWindow.OTHER, () => {
        //            lname = TweenAlpha.Begin(gameObject, 1.5f, 1);
        //            lname.from = 0;
        //        });
        //    });
        //};
        if (cardName != null)
        {
            string color = QualityManagerment.getQualityColor(magicWeap.getMagicWeaponQuality());
            cardName.text = color + magicWeap.getName() + "[-]";
            GameObject card_name = NGUITools.AddChild(obj, cardName.gameObject);
            card_name.transform.localScale    = new Vector3(0.8f, 0.8f, 1);
            card_name.transform.localPosition = new Vector3(0, -70, 0);
            card_name.SetActive(true);
        }
    }
Exemplo n.º 2
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 = "";
            }
        }
    }
    public void showUI()
    {
        switch (tapType)
        {
        case 0:
            if (info.isUse == 0)
            {
                useSprite.alpha = 0;
            }
            else
            {
                useSprite.alpha      = 1;
                useSprite.spriteName = "text_share";
            }
            showItem.GetComponent <BoxCollider>().enabled = false;

            string sidOne = "";
            if (showType != FriendsShareManagerment.TYPE_JINHUA)
            {
                sidOne = info.sid.getValueString();
            }
            switch (showType)
            {
            case FriendsShareManagerment.TYPE_CARD:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
                Card   card        = CardManagerment.Instance.createCard(StringKit.toInt(sidOne));
                string quilityCard = QualityManagerment.getQualityName(card.getQualityId()) + "[-]";
                string nameCard    = QualityManagerment.getQualityColor(card.getQualityId()) + card.getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, quilityCard, nameCard);
                break;

            case FriendsShareManagerment.TYPE_EQUIP:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
                Equip  equip        = EquipManagerment.Instance.createEquip(StringKit.toInt(sidOne));
                string quilityEquip = QualityManagerment.getQualityName(equip.getQualityId()) + "[-]";
                string nameEquip    = QualityManagerment.getQualityColor(equip.getQualityId()) + equip.getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, quilityEquip, nameEquip);
                break;

            case FriendsShareManagerment.TYPE_MAGICWEAPON:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
                MagicWeapon mw        = MagicWeaponManagerment.Instance.createMagicWeapon(StringKit.toInt(sidOne));
                string      quilitymw = QualityManagerment.getQualityName(mw.getMagicWeaponQuality()) + "[-]";
                string      namemw    = QualityManagerment.getQualityColor(mw.getMagicWeaponQuality()) + mw.getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, quilitymw, namemw);
                break;

            case FriendsShareManagerment.TYPE_XIULIAN:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;

            case FriendsShareManagerment.TYPE_TAOFA:
                Mission mss = MissionInfoManager.Instance.getMissionBySid(StringKit.toInt(sidOne));
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, mss.getMissionName());
                break;

            case FriendsShareManagerment.TYPE_JUQING:
                Mission       mssJq     = MissionInfoManager.Instance.getMissionBySid(StringKit.toInt(sidOne));
                ChapterSample chapterJq = ChapterSampleManager.Instance.getChapterSampleBySid(mssJq.getChapterSid());
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, chapterJq.name);
                break;

            case FriendsShareManagerment.TYPE_PVP:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;

            case FriendsShareManagerment.TYPE_SHENGQI:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;

            case FriendsShareManagerment.TYPE_XINGPAN:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;

            case FriendsShareManagerment.TYPE_JINHUA:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
//				Card cardJinhua = CardManagerment.Instance.createCard(StringKit.toInt(sid));
                ServerCardMsg cardServer     = CardManagerment.Instance.createCardByChatServer(info.sid as ErlArray);
                string        nameCardJinhua = QualityManagerment.getQualityColor(cardServer.card.getQualityId()) + cardServer.card.getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, nameCardJinhua);
                break;

            case FriendsShareManagerment.TYPE_SHENGJI:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;

            case FriendsShareManagerment.TYPE_NVSHEN:
                Card   cardNvshen = CardManagerment.Instance.createCard(StringKit.toInt(sidOne));
                string nvshenName = QualityManagerment.getQualityColor(cardNvshen.getQualityId()) + cardNvshen.getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, nvshenName);
                break;

            case FriendsShareManagerment.TYPE_TUPO:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType);
                break;

            case FriendsShareManagerment.TYPE_YXZHIZHANG:
                MissionSample mission = MissionSampleManager.Instance.getMissionSampleBySid(StringKit.toInt(sidOne));
                ChapterSample chsam   = ChapterSampleManager.Instance.getChapterSampleBySid(mission.chapterSid);
                int           gc      = StringKit.toInt(sidOne) - chsam.missions[0] + 1;
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, mission.name, gc.ToString());
                break;

            case FriendsShareManagerment.TYPE_JWTISHENG:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, KnighthoodConfigManager.Instance.getKnighthoodByGrade(StringKit.toInt(info.sid.getValueString().ToString())).kName);
                break;

            case FriendsShareManagerment.TYPE_XINGHUN:
                StarSoulSample sample     = StarSoulSampleManager.Instance.getStarSoulSampleBySid(StringKit.toInt(sidOne));
                string         sampleName = QualityManagerment.getQualityColor(sample.qualityId) + sample.name + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sampleName);
                break;

            case FriendsShareManagerment.TYPE_ZUOQI:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, MountsManagerment.Instance.createMounts(StringKit.toInt(sidOne)).getName());
                break;

            case FriendsShareManagerment.TYPE_VIP:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, UserManager.Instance.self.nickname, sidOne);
                break;

            case FriendsShareManagerment.TYPE_LADDER:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;

            case FriendsShareManagerment.TYPE_ARENA:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;

            case FriendsShareManagerment.TYPE_JINGCAI:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType);
                break;

            case FriendsShareManagerment.TYPE_BEAST:
                //showItem.GetComponent<BoxCollider>().enabled = true;
                //showItem.info = info;
                BeastEvolve beast     = BeastEvolveManagerment.Instance.getBeastEvolveBySid(StringKit.toInt(sidOne));
                string      beastName = QualityManagerment.getQualityColor(beast.getBeast().getQualityId()) + beast.getBeast().getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, beastName);
                break;

            case FriendsShareManagerment.TYPE_QISHU:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_Mine" + showType, sidOne);
                break;
            }
            break;

        case 1:
            CardSample cs;
            if (info.isUse == 0)
            {
                useSprite.alpha = 0;
            }
            else
            {
                useSprite.alpha      = 1;
                useSprite.spriteName = "text_applaud";
            }
            string name = info.name;
            string vip1 = info.vip;
            string vip  = "";
            if (vip1 == "0")
            {
                vip = "";
            }
            else
            {
                vip = "<VIP" + vip1 + ">";
            }
            DateTime dt   = TimeKit.getDateTime(StringKit.toInt(info.time));
            string   time = "[" + dt.Hour + ":" + dt.Minute + "]";
            showItem.GetComponent <BoxCollider>().enabled = false;

            string sidTwo = "";
            if (showType != FriendsShareManagerment.TYPE_JINHUA)
            {
                sidTwo = info.sid.getValueString();
            }
            switch (info.type)
            {
            case FriendsShareManagerment.TYPE_CARD:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
                cs            = CardSampleManager.Instance.getRoleSampleBySid(StringKit.toInt(sidTwo));
                if (cs == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, "[-]", sidTwo);
                    break;
                }
                else
                {
                    Card   card        = CardManagerment.Instance.createCard(StringKit.toInt(sidTwo));
                    string quilityCard = QualityManagerment.getQualityName(card.getQualityId()) + "[-]";
                    string nameCard    = QualityManagerment.getQualityColor(card.getQualityId()) + card.getName() + "[-]";
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, quilityCard, nameCard);
                    break;
                }

            case FriendsShareManagerment.TYPE_EQUIP:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
                if (EquipmentSampleManager.Instance.getEquipSampleBySid(StringKit.toInt(sidTwo)) == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, "[-]", sidTwo);
                    break;
                }
                else
                {
                    Equip  equip        = EquipManagerment.Instance.createEquip(StringKit.toInt(sidTwo));
                    string quilityEquip = QualityManagerment.getQualityName(equip.getQualityId()) + "[-]";
                    string nameEquip    = QualityManagerment.getQualityColor(equip.getQualityId()) + equip.getName() + "[-]";
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, quilityEquip, nameEquip);
                    break;
                }

            case FriendsShareManagerment.TYPE_MAGICWEAPON:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
                if (MagicWeaponManagerment.Instance.createMagicWeapon(StringKit.toInt(sidTwo)) == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, "[-]", sidTwo);
                    break;
                }
                else
                {
                    MagicWeapon equip        = MagicWeaponManagerment.Instance.createMagicWeapon(StringKit.toInt(sidTwo));
                    string      quilityMagic = QualityManagerment.getQualityName(equip.getMagicWeaponQuality()) + "[-]";
                    string      nameMagic    = QualityManagerment.getQualityColor(equip.getMagicWeaponQuality()) + equip.getName() + "[-]";
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, time, quilityMagic, nameMagic);
                    break;
                }

            case FriendsShareManagerment.TYPE_XIULIAN:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, sidTwo);
                break;

            case FriendsShareManagerment.TYPE_TAOFA:
                if (MissionSampleManager.Instance.getMissionSampleBySid(StringKit.toInt(sidTwo)) == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, sidTwo);
                    break;
                }
                else
                {
                    Mission mss = MissionInfoManager.Instance.getMissionBySid(StringKit.toInt(sidTwo));
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, mss.getMissionName());
                    break;
                }

            case FriendsShareManagerment.TYPE_JUQING:
                if (MissionSampleManager.Instance.getMissionSampleBySid(StringKit.toInt(sidTwo)) == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, sidTwo);
                    break;
                }
                else
                {
                    Mission mssJuqing = MissionInfoManager.Instance.getMissionBySid(StringKit.toInt(sidTwo));
                    if (ChapterSampleManager.Instance.getChapterSampleBySid(mssJuqing.getChapterSid()) == null)
                    {
                        showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, time, sidTwo);
                        break;
                    }
                    else
                    {
                        ChapterSample chapterJq = ChapterSampleManager.Instance.getChapterSampleBySid(mssJuqing.getChapterSid());
                        showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, chapterJq.name);
                        break;
                    }
                }

            case FriendsShareManagerment.TYPE_PVP:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                break;

            case FriendsShareManagerment.TYPE_SHENGQI:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                break;

            case FriendsShareManagerment.TYPE_XINGPAN:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                break;

            case FriendsShareManagerment.TYPE_JINHUA:
                showItem.GetComponent <BoxCollider>().enabled = true;
                showItem.info = info;
//				Card cardJinhua = CardManagerment.Instance.createCard(StringKit.toInt(sidTwo));
                ServerCardMsg cardServer     = CardManagerment.Instance.createCardByChatServer(info.sid as ErlArray);
                string        nameCardJinhua = QualityManagerment.getQualityColor(cardServer.card.getQualityId()) + cardServer.card.getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, nameCardJinhua);
                break;

            case FriendsShareManagerment.TYPE_SHENGJI:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                break;

            case FriendsShareManagerment.TYPE_NVSHEN:
                cs = CardSampleManager.Instance.getRoleSampleBySid(StringKit.toInt(sidTwo));
                if (cs == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                    break;
                }
                else
                {
                    Card   cardNvshen = CardManagerment.Instance.createCard(StringKit.toInt(sidTwo));
                    string nvshenName = QualityManagerment.getQualityColor(cardNvshen.getQualityId()) + cardNvshen.getName() + "[-]";
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, nvshenName);
                    break;
                }

            case FriendsShareManagerment.TYPE_TUPO:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip);
                break;

            case FriendsShareManagerment.TYPE_YXZHIZHANG:
                MissionSample mission = MissionSampleManager.Instance.getMissionSampleBySid(StringKit.toInt(sidTwo));
                if (mission == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo, sidTwo);
                    break;
                }
                ChapterSample chsam = ChapterSampleManager.Instance.getChapterSampleBySid(mission.chapterSid);
                if (chsam == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, mission.name, sidTwo);
                    break;
                }
                int gc = StringKit.toInt(sidTwo) - chsam.missions[0] + 1;
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, mission.name, gc.ToString());
                break;

            case FriendsShareManagerment.TYPE_JWTISHENG:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip);
                break;

            case FriendsShareManagerment.TYPE_XINGHUN:
                StarSoulSample sample     = StarSoulSampleManager.Instance.getStarSoulSampleBySid(StringKit.toInt(sidTwo));
                string         sampleName = QualityManagerment.getQualityColor(sample.qualityId) + sample.name + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sampleName);
                break;

            case FriendsShareManagerment.TYPE_ZUOQI:
                if (MountsSampleManager.Instance.getMountsSampleBySid(StringKit.toInt(sidTwo)) == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                    break;
                }
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, MountsManagerment.Instance.createMounts(StringKit.toInt(sidTwo)).getName());
                break;

            case FriendsShareManagerment.TYPE_VIP:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip);
                break;

            case FriendsShareManagerment.TYPE_LADDER:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip);
                break;

            case FriendsShareManagerment.TYPE_ARENA:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                break;

            case FriendsShareManagerment.TYPE_JINGCAI:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip);
                break;

            case FriendsShareManagerment.TYPE_BEAST:
                BeastEvolve beast = BeastEvolveManagerment.Instance.getBeastEvolveBySid(StringKit.toInt(sidTwo));
                if (beast == null)
                {
                    showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                    break;
                }
                string beastName = QualityManagerment.getQualityColor(beast.getBeast().getQualityId()) + beast.getBeast().getName() + "[-]";
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, beastName);
                break;

            case FriendsShareManagerment.TYPE_QISHU:
                showLabel.text = LanguageConfigManager.Instance.getLanguage("Share_F" + showType, name, vip, sidTwo);
                break;
            }
            break;
        }
    }
Exemplo n.º 4
0
    private ExchangeSample magicExSamle; //神器兑换模板

    public void init(Exchange ex)
    {
        ExchangeSample sample = ex.getExchangeSample();

        this.magicExSamle = sample;
        //按钮显示判断
        int count = ExchangeManagerment.Instance.getCanExchangeNum(ex);

        if (count <= 0)
        {
            buttonExchange.disableButton(true);
        }
        else
        {
            buttonExchange.disableButton(false);
        }
        //数量9240c
        numLabel.text = "[92400c]" + LanguageConfigManager.Instance.getLanguage("store03") + "[-]" + EquipScrapManagerment.Instance.getNumString(sample);
        //存信息到兑换按钮
        buttonExchange.fatherWindow = fawin;
        buttonExchange.updateButton(ex);
        //显示装备
        if (sample.exType == 8)
        {
            MagicWeapon nw = MagicWeaponManagerment.Instance.createMagicWeapon(sample.exchangeSid);
            magicW         = nw;
            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 = "";
            }
        }
        else
        {
            Equip equip = EquipManagerment.Instance.createEquip(sample.exchangeSid);
            //名称
            nameLabel.text = QualityManagerment.getQualityColor(equip.getQualityId()) + equip.getName();;
            if (button == null)
            {
                item      = NGUITools.AddChild(gameObject, goodsViewPrefab);
                item.name = "goodsView";
                button    = item.GetComponent <GoodsView>();
            }
            if (button != null && equip != null)
            {
                button.init(equip);
                button.fatherWindow         = fawin;
                button.rightBottomText.text = "";
            }
        }
    }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }
Exemplo n.º 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);
            }
        }
    }
Exemplo n.º 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);
    }