コード例 #1
0
 private void findAllpart(SuitSample ss)
 {
     for (int i = 0; i < part.Length; i++)
     {
         partBg [i].gameObject.SetActive(false);
         partIco [i].gameObject.SetActive(false);
     }
     for (int i = 0; i < ss.parts.Count; i++)
     {
         EquipSample es = null;
         if (chooseEquip.getQualityId() <= 5)
         {
             es = EquipmentSampleManager.Instance.getEquipSampleBySid(ss.parts [i].ySid);
         }
         else if (chooseEquip.getQualityId() == 6)
         {
             es = EquipmentSampleManager.Instance.getEquipSampleBySid(ss.parts[i].rSid);
         }
         if (es == null)
         {
             continue;
         }
         partBg [i].gameObject.SetActive(true);
         partBg [i].spriteName = QualityManagerment.qualityIDToIconSpriteName(es.qualityId);
         partIco [i].gameObject.SetActive(true);
         ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + es.iconId, partIco [i]);
     }
 }
コード例 #2
0
    //设置创建按钮信息
    private void setCreatButton(PrizeSample _prize)
    {
        if (_prize == null)
        {
            return;
        }
        else
        {
            prize = _prize;
            icon.gameObject.SetActive(false);
            back.spriteName = QualityManagerment.qualityIDToIconSpriteName(_prize.getQuality());
            switch (prize.type)
            {
            case PrizeType.PRIZE_MONEY:
                ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.MONEY_ICONPATH, icon);
                num.text = "x" + prize.num.ToString();
                break;

            case PrizeType.PRIZE_PROP:
                Prop prop = PropManagerment.Instance.createProp(prize.pSid);
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + prop.getIconId(), icon);
                num.text = "x" + prize.num.ToString();
                break;

            case PrizeType.PRIZE_RMB:
                ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.RMB_ICONPATH, icon);
                num.text = "x" + prize.num.ToString();
                break;
            }
            icon.gameObject.SetActive(true);
        }
    }
コード例 #3
0
 //初始化,带入3大类技能的升级信息
 public void Initialize(Equip _equip, LevelupInfo info)
 {
     /* 初始化数据 */
     equip       = _equip;
     equipExpSID = EquipmentSampleManager.Instance.getEquipSampleBySid(equip.sid).levelId;
     nowLv       = info.oldLevel;
     targetLv    = info.newLevel;
     tipNowExp   = info.oldExp;
     updateProgressLabel();
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), equipImage);
     qualityBack.spriteName = QualityManagerment.qualityIDToIconSpriteName(equip.getQualityId());
     level.text             = "Lv." + info.oldLevel + "/" + equip.getMaxLevel();
     nameLabel.text         = equip.getName();
     AttrChange[] attrsOld = equip.getAttrChanges(info.oldLevel);
     AttrChange[] attrsNew = equip.getAttrChanges(info.newLevel);
     tipProgressLabel.text = "";
     attrLabel1.text       = "";
     attrLabel2.text       = "";
     if (attrsOld != null)
     {
         if (attrsOld.Length > 0 && attrsOld [0] != null)
         {
             attrLabel1.text = "[6E483F]" + attrsOld[0].typeToString() + attrsOld[0].num + "[-][418159] + " + (attrsNew[0].num - attrsOld[0].num);
         }
         if (attrsOld.Length > 1 && attrsOld [1] != null)
         {
             attrLabel2.text = "[6E483F]" + attrsOld[1].typeToString() + attrsOld[1].num + "[-][418159] + " + (attrsNew[1].num - attrsOld[1].num);
         }
     }
     expbar.init(info);
     /** 进度条升级回调 */
     expbar.setLevelUpCallBack(showLevelupSign);
     /** 进度条动画播完回调 */
     expbar.endCall = OnExpBarEnd;
 }
コード例 #4
0
 public void updateButton(Equip newEquip)
 {
     if (newEquip == null)
     {
         cleanButton();
         return;
     }
     else
     {
         equip = newEquip;
         ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), equipImage);
         level.text    = "Lv." + equip.getLevel().ToString();
         bg.spriteName = QualityManagerment.qualityIDToIconSpriteName(equip.getQualityId());
         resetCard();
         if (!win.isSelect(equip))
         {
             isChoose        = false;
             selectPic.alpha = 0;
         }
         else
         {
             isChoose        = true;
             selectPic.alpha = 1;
         }
     }
 }
コード例 #5
0
 //设置创建按钮信息
 private void setCreatButton(PrizeSample _prize)
 {
     if (_prize == null)
     {
         return;
     }
     else
     {
         prize = _prize;
         icon.gameObject.SetActive(false);
         back.spriteName = QualityManagerment.qualityIDToIconSpriteName(_prize.getQuality());
         count           = StringKit.toInt(prize.num);
         if (prize.type == PrizeType.PRIZE_CARD)
         {
             card = CardManagerment.Instance.createCard(prize.pSid);
         }
         else if (prize.type == PrizeType.PRIZE_EQUIPMENT)
         {
             equip = EquipManagerment.Instance.createEquip(prize.pSid);
         }
         else if (prize.type == PrizeType.PRIZE_MAGIC_WEAPON)
         {
             magicWeapon = MagicWeaponManagerment.Instance.createMagicWeapon(prize.pSid);
         }
         else if (prize.type == PrizeType.PRIZE_PROP)
         {
             prop = PropManagerment.Instance.createProp(prize.pSid);
         }
         else if (prize.type == PrizeType.PRIZE_STARSOUL)
         {
             starSoul = StarSoulManager.Instance.createStarSoul(prize.pSid);
         }
         updateInfo();
     }
 }
コード例 #6
0
 /** 初始化顶部的小头像图标按钮 */
 public void init(Card card)
 {
     this.onClickEvent = onItemMoveHander;
     if (contentStarSoulEquitop == null)
     {
         contentStarSoulEquitop = transform.parent.GetComponent <ContentStarSoulEquiTop> ();
     }
     data = card;
     if (data != null)
     {
         if (data.isMainCard())            //如果是主卡
         {
             ResourcesManager.Instance.LoadAssetBundleTexture(UserManager.Instance.self.getIconPath(), icon);
             icon.transform.localScale = new Vector3(0.9f, 0.9f, 0f);
         }
         else
         {
             ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + data.getIconID().ToString(), icon);
             icon.transform.localScale = new Vector3(1f, 1f, 0f);
         }
         bg_Sprite.spriteName = QualityManagerment.qualityIDToIconSpriteName(data.getQualityId());
         if (quality != null)
         {
             quality.spriteName = "quality_" + card.getQualityId();
         }
     }
 }
コード例 #7
0
    private void updateEquipItem()
    {
        Equip tempEquip = StorageManagerment.Instance.getEquipTypeBySid(noticeContent.getSourceEquipSid());

        if (checkEquipIndex() != 0)
        {
            isHaveEquip = true;
        }

        if (IN_STORE == checkEquipIndex())
        {
            oldEquip = StorageManagerment.Instance.getEquipTypeBySid(noticeContent.getSourceEquipSid());
        }
        else
        {
            oldEquip = EquipManagerment.Instance.createEquip(noticeContent.getSourceEquipSid());
        }
        if (newEquip == null)
        {
            newEquip = EquipManagerment.Instance.createEquip("", noticeContent.getTargetEquipSid(), oldEquip.getEXP(), 0, oldEquip.getrefineEXP());
        }
        if (isHaveEquip)
        {
            noEquipGroup.SetActive(false);
            equipGroup.SetActive(true);
            if (oldEquip != null)
            {
                oldNameLabel.text           = QualityManagerment.getQualityColor(oldEquip.getQualityId()) + "Lv." + oldEquip.getLevel() + oldEquip.getName();
                oldQualitySprite.spriteName = QualityManagerment.qualityIDToIconSpriteName(oldEquip.getQualityId());
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + oldEquip.getIconId(), oldIconSprite);
                AttrChange[] attrs = oldEquip.getAttrChanges();
                if (attrs != null)
                {
                    if (attrs.Length > 0 && attrs [0] != null)
                    {
                        oldAttrLabel.text = attrs [0].typeToString() + attrs [0].num;
                    }
                }
            }
            if (newEquip != null)
            {
                newNameLabel.text          = QualityManagerment.getQualityColor(newEquip.getQualityId()) + "Lv." + newEquip.getLevel() + newEquip.getName();
                newQulitySprite.spriteName = QualityManagerment.qualityIDToIconSpriteName(newEquip.getQualityId());
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + newEquip.getIconId(), newIconSprite);
                AttrChange[] attrs = newEquip.getAttrChanges();
                if (attrs != null)
                {
                    if (attrs.Length > 0 && attrs [0] != null)
                    {
                        newAttrLabel.text = attrs [0].typeToString() + attrs [0].num;
                    }
                }
            }
        }
        else
        {
            noEquipGroup.SetActive(true);
            equipGroup.SetActive(false);
        }
    }
コード例 #8
0
 public void init(GoddessUnitWindow win, Card selectCard, string index)
 {
     card = selectCard;
     winn = win as GoddessUnitWindow;
     if (card == null)
     {
         lvLabel.gameObject.SetActive(false);
         icon.gameObject.SetActive(false);
         EmptyIcon.gameObject.SetActive(true);
         if (index != "")
         {
             ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.GODDESS_EMTY + index + "_e", EmptyIcon);
         }
         iconBg.gameObject.SetActive(true);
         iconBg.spriteName = "IconBack";
     }
     else
     {
         lvLabel.gameObject.SetActive(true);
         icon.gameObject.SetActive(true);
         iconBg.gameObject.SetActive(true);
         EmptyIcon.gameObject.SetActive(false);
         ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.GODDESS_HEAD2 + card.getImageID() + "_h", icon);
         iconBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(card.getQualityId());
         lvLabel.text      = "Lv." + card.getLevel() + "/" + card.getMaxLevel();
     }
 }
コード例 #9
0
ファイル: PictureButton.cs プロジェクト: xiney1986/SDKProject
 public void init(Card card)
 {
     this.card            = card;
     name.text            = card.getName();
     qualityBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(card.getQualityId());
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + card.getIconID().ToString(), icon);
 }
コード例 #10
0
 public void cleanData()
 {
     equip = null;
     equipImage.gameObject.SetActive(false);
     level.text = "";
     if (starLvel != null)
     {
         starLvel.gameObject.SetActive(false);
     }
     qualityBack.gameObject.SetActive(true);
     qualityBack.spriteName = QualityManagerment.qualityIDToIconSpriteName(1);
 }
コード例 #11
0
    //用于目标兑换物品的按钮更新
    public void updateButton(ExchangeSample sample, int type)
    {
        cleanData();
        Image.gameObject.SetActive(true);
        this.type = type;



        if (sample.type == PrizeType.PRIZE_CARD)
        {
            Card showCard = CardManagerment.Instance.createCard(sample.exchangeSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + showCard.getImageID(), Image);
            Image.width  = (int)bigPic.x;
            Image.height = (int)bigPic.y;
            icon_back.gameObject.SetActive(true);
            icon_back.width      = (int)bigPicBg.x;
            icon_back.height     = (int)bigPicBg.y;
            icon_back.spriteName = QualityManagerment.qualityIDToBackGround(showCard.getQualityId());
            setNormalSprite(icon_back.spriteName);
            textLabel.text = "x" + sample.num;
            item           = showCard;
        }
        else if (sample.type == PrizeType.PRIZE_EQUIPMENT)
        {
            Equip showEquip = EquipManagerment.Instance.createEquip(sample.exchangeSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + showEquip.getIconId(), Image);
            Image.width  = (int)smallPic.x;
            Image.height = (int)smallPic.y;
            icon_back.gameObject.SetActive(true);
            icon_back.width      = (int)iconPic.x;
            icon_back.height     = (int)iconPic.y;
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(showEquip.getQualityId());
            setNormalSprite(icon_back.spriteName);
            textLabel.text = "x" + sample.num;
            item           = showEquip;
        }
        else if (sample.type == PrizeType.PRIZE_PROP)
        {
            Prop showProp = PropManagerment.Instance.createProp(sample.exchangeSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + showProp.getIconId(), Image);
            Image.width  = (int)smallPic.x;
            Image.height = (int)smallPic.y;
            icon_back.gameObject.SetActive(true);
            icon_back.width      = (int)iconPic.x;
            icon_back.height     = (int)iconPic.y;
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(showProp.getQualityId());
            setNormalSprite(icon_back.spriteName);
            textLabel.text = "x" + sample.num;
            item           = showProp;
        }
    }
コード例 #12
0
    public void Initialize(PrizeSample _prize)
    {
        this.prize = _prize;
        if (prize != null)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(prize.getIconPath(), propImage);
            propName.text = prize.getPrizeName() + "";
            if (prize.type == PrizeType.PRIZE_MERIT)
            {
                propHaveNumber.text = LanguageConfigManager.Instance.getLanguage("intensifyEquip04") + UserManager.Instance.self.merit.ToString();
            }
            else
            {
                Prop pp = StorageManagerment.Instance.getProp(prize.pSid);
                if (pp == null)
                {
                    propHaveNumber.text = LanguageConfigManager.Instance.getLanguage("intensifyEquip04") + "0";
                }
                else
                {
                    propHaveNumber.text = LanguageConfigManager.Instance.getLanguage("intensifyEquip04") + pp.getNum().ToString();
                }
            }

            propDescript.text  = prize.getPrizeDes();
            quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(prize.getQuality());
            if (prize.type == PrizeType.PRIZE_PROP)
            {
                Prop propTemp = PropManagerment.Instance.createProp(prize.pSid);
                if (propTemp.isCardScrap() && starPrefab != null)
                {
                    Card card = CardScrapManagerment.Instance.getCardByScrapSid(propTemp.sid);//根据卡片碎片id获取对应卡片
                    showStar(card);
                }
                if (scrapIcon != null)
                {
                    if (propTemp.isScrap())
                    {
                        scrapIcon.gameObject.SetActive(true);
                    }
                    else
                    {
                        scrapIcon.gameObject.SetActive(false);
                    }
                }
            }
        }
    }
コード例 #13
0
    public void Initialize()
    {
        beastList = BeastEvolveManagerment.Instance.getAllBest();
        //init item

        foreach (GoddessContentItem tmp in goddessItems)
        {
            BeastEvolve be = null;
            be = beastList.Find((beast) => {
                if (beast.getBeast().getImageID() == StringKit.toInt(tmp.gameObject.name))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            });
            if (be != null)
            {
                //获取头像图标
                tmp.fatherWindow = this;
                tmp.beast        = be.getBeast();
                if (be.isAllExist())
                {
                    ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.GODDESS_HEAD2 + be.getBeast().getImageID() + "_h", tmp.headIcon);
                    tmp.headIcon.gameObject.SetActive(true);
                    tmp.emptyIcon.gameObject.SetActive(false);
                    tmp.evolutionIcon.gameObject.SetActive(true);
                    tmp.level.gameObject.SetActive(true);
                    tmp.evolutionIcon.spriteName = QualityManagerment.qualityIDToString(be.getBeast().getQualityId());
                    tmp.evolutionTimes.text      = be.getBeast().getQualityId().ToString();
                    tmp.level.text = "Lv." + be.getBeast().getLevel() + "/" + be.getBeast().getMaxLevel();
                    //获取品质图标
                    tmp.qualityIcon.spriteName = QualityManagerment.qualityIDToIconSpriteName(be.getBeast().getQualityId());
                }
            }
        }
        rushCombat();
        tipsGameObject.SetActive(checkShowTips());
        if (GuideManager.Instance.isEqualStep(16003000))
        {
            GuideManager.Instance.guideEvent();
        }
        //尝试执行友善指引
        GuideManager.Instance.doFriendlyGuideEvent();
    }
コード例 #14
0
    // Use this for initialization

    public void Initialize(PropMessageLineWindow father, int y, PrizeSample prize)
    {
        targetY      = y;
        fatherWindow = father;
        this.prize   = prize;
        iconBg.gameObject.SetActive(false);
        icon.mainTexture = null;
        if (prize == null)
        {
            return;
        }
        if (prize.type == PrizeType.PRIZE_STARSOUL)
        {
            iconBg.gameObject.SetActive(true);
            iconBg.spriteName = "iconback_3";
            StarSoul starsoulView = StarSoulManager.Instance.createStarSoul(prize.pSid);
            msgText.text = starsoulView.getName();
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.STARSOUL_ICONPREFAB_PATH + starsoulView.getIconId(), icon.transform, (obj) => {
                GameObject gameObj = obj as GameObject;
                if (gameObj != null)
                {
                    Transform childTrans = gameObj.transform;
                    if (childTrans != null)
                    {
                        StarSoulEffectCtrl effectCtrl = childTrans.gameObject.GetComponent <StarSoulEffectCtrl>();
                        effectCtrl.setColor(starsoulView.getQualityId());
                    }
                }
            });
        }
        else if (prize.type == -1)
        {
            iconBg.gameObject.SetActive(false);
            msgText.text = prize.prizeDec;
            return;
        }
        else
        {
            iconBg.gameObject.SetActive(true);
            iconBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(prize.getQuality());
            ResourcesManager.Instance.LoadAssetBundleTexture(prize.getIconPath(), icon);
            msgText.text = prize.getPrizeName();
        }
        //msgText.text =QualityManagerment.getQualityColor( prize.getQuality ()) +prize.getPrizeName ();

        msgText.text += " x " + prize.getPrizeNumByInt();
    }
コード例 #15
0
    /** 公共信息的更新 */
    private void updateComon(Mounts mounts)
    {
        name.text = temp.getExhangeItemName();
        if (mounts != null)
        {
            fight.text = mounts.getCombat().ToString();
        }
        MountsSample mountsSample = MountsSampleManager.Instance.getMountsSampleBySid(temp.exchangeSid);
        Mounts       activeMounts = MountsManagerment.Instance.getMountsBySid(temp.exchangeSid);

        if (mountsSample.isShowTime && activeMounts != null)
        {
            timeObject.SetActive(true);
        }
        else
        {
            timeObject.SetActive(false);
        }
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + mountsSample.imageID.ToString(), icon);
        iconBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(mountsSample.qualityId);
    }
コード例 #16
0
 public void Initialize(Prop chooseItem, Goods good, CallBack callback)
 {
     this.callback = callback;
     this.goods    = good;
     chooseProp    = chooseItem;
     if (chooseProp != null)
     {
         ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + chooseProp.getIconId(), propImage);
         propName.text = QualityManagerment.getQualityColor(chooseProp.getQualityId()) + chooseProp.getName() + "";
         Prop pp = StorageManagerment.Instance.getProp(chooseItem.sid);
         if (chooseItem.isCardScrap() && stars != null)
         {
             Card card = CardScrapManagerment.Instance.getCardByScrapSid(chooseItem.sid);//根据卡片碎片id获取对应卡片
             showStar(card);
         }
         if (pp == null)
         {
             propHaveNumber.text = LanguageConfigManager.Instance.getLanguage("intensifyEquip04") + "0";
         }
         else
         {
             propHaveNumber.text = LanguageConfigManager.Instance.getLanguage("intensifyEquip04") + pp.getNum().ToString();
         }
         propDescript.text  = chooseProp.getDescribe();
         quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(chooseProp.getQualityId());
         if (scrapIcon != null)
         {
             if (chooseProp.isScrap())
             {
                 scrapIcon.gameObject.SetActive(true);
             }
             else
             {
                 scrapIcon.gameObject.SetActive(false);
             }
         }
         updateConstIcon();
         updateByButtonState();
     }
 }
コード例 #17
0
    private void initUI()
    {
        switch (psType)
        {
        case 1:
            ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.MONEY_ICONPATH, Image);
            textLabel.text = ((psNum > UserManager.Instance.self.getMoney())?Colors.RED:Colors.GREEN) + psNum;
            //textLabel.text =  psNum.ToString();
            if (fatherWindow is MainCardEvolutionWindow)
            {
                moneyOwned.text = ((psNum > UserManager.Instance.self.getMoney())?Colors.RED:Colors.GREEN) + UserManager.Instance.self.getMoney();
                moneyOwned.text = UserManager.Instance.self.getMoney().ToString();
            }
            psname = LanguageConfigManager.Instance.getLanguage("money");
            break;

        case 2:
            ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.RMB_ICONPATH, Image);
            textLabel.text = ((psNum > UserManager.Instance.self.getRMB())?Colors.RED:Colors.GREEN) + psNum;
            //textLabel.text =  psNum.ToString();
            psname = LanguageConfigManager.Instance.getLanguage("rmb");
            break;

        case 3:
            Prop showProp = StorageManagerment.Instance.getProp(psSid);
            Prop prop     = PropManagerment.Instance.createProp(psSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + prop.getIconId(), Image);
            int num = showProp == null ? 0:showProp.getNum();
            textLabel.text = ((psNum > num)?Colors.RED:Colors.GREEN) + num + "/" + psNum;
            //textLabel.text = num + "/" + psNum;
            psname = prop.getName();
            break;
        }

        if (bg != null)
        {
            bg.spriteName = QualityManagerment.qualityIDToIconSpriteName(PropManagerment.Instance.createProp(psSid).getQualityId());
        }
    }
コード例 #18
0
 //最原始的初始化
 public void init(object obj, int numberMax, int numberMin, int numberNow, int numberSetp, int costType, CallBackMsg callback)
 {
     msg           = new MessageHandle();
     msg.msgInfo   = obj;
     item          = obj;
     this.callback = callback;
     setp          = numberSetp;
     max           = numberMax;
     min           = numberMin;
     now           = numberNow;
     coverDistanceToOne();
     this.costType = costType;
     updateCoinIcon();
     updateDisplayeNumber();
     calculateTotal();
     if (obj.GetType() == typeof(Goods))
     {
         Goods good = item as Goods;
         Prop  p    = PropManagerment.Instance.createProp(good.getGoodsSid());
         if (p != null)
         {
             nameBg.text   = QualityManagerment.getQualityColor(p.getQualityId()) + p.getName() + "[-]";
             nameDecc.text = LanguageConfigManager.Instance.getLanguage("s03l6", now.ToString(), p.getName());
         }
         titleText.text = (obj as Goods).getName();
         ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + good.getIconId(), goodsTexture);
         goodsTexture.gameObject.SetActive(true);
         goodsBg.gameObject.SetActive(true);
         if (good.getGoodsType() == PrizeType.PRIZE_EQUIPMENT)
         {
             goodsBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(EquipmentSampleManager.Instance.getEquipSampleBySid(good.getGoodsSid()).qualityId);
         }
         else if (good.getGoodsType() == PrizeType.PRIZE_PROP)
         {
             goodsBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(PropSampleManager.Instance.getPropSampleBySid(good.getGoodsSid()).qualityId);
         }
     }
 }
コード例 #19
0
    public void Initialize(EquipAward item, AwardDisplayCtrl ctrl)
    {
        EquipSample sample = EquipmentSampleManager.Instance.getEquipSampleBySid(item.sid);

        itemName.text = LanguageConfigManager.Instance.getLanguage("s0058") + sample.name;
        string count;

        if (item.num == 0)
        {
            count = "x1";
        }
        else
        {
            count = "x" + item.num;
        }

        itemName.text       += count;
        itemImage.width      = 256;
        itemImage.height     = 256;
        qualityBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(sample.qualityId);
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + sample.iconId, itemImage);
        Initialize(ctrl);
    }
コード例 #20
0
    public void Initialize(PropAward item, AwardDisplayCtrl ctrl)
    {
        PropSample sample = PropSampleManager.Instance.getPropSampleBySid(item.sid);
        Prop       tmp    = PropManagerment.Instance.createProp(sample.sid);

        if (tmp.isMagicScrap())
        {
            Utils.RemoveAllChild(itemImage.transform);
            MagicWeapon magic = MagicWeaponScrapManagerment.Instance.getMagicWeaponByScrapSid(tmp.sid);
            GameObject  obj   = NGUITools.AddChild(itemImage.gameObject, starPerfab);
            ShowStars   show  = obj.GetComponent <ShowStars>();
            show.init(magic, MagicWeaponManagerment.USEDBUMAGIC_AWARD);
        }
        itemName.text = LanguageConfigManager.Instance.getLanguage("s0058") + sample.name;
        string count;

        if (item.num == 0)
        {
            count = "x1";
        }
        else
        {
            count = "x" + item.num;
        }
        itemName.text += count;

        itemImage.width  = 256;
        itemImage.height = 256;
        if (item.sid == 71181)
        {
            itemImage.width  = 180;
            itemImage.height = 180;
        }
        qualityBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(sample.qualityId);
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + sample.iconId, itemImage);
        Initialize(ctrl);
    }
コード例 #21
0
    public void Initialize(CardAward item, AwardDisplayCtrl ctrl)
    {
        CardSample sample = CardSampleManager.Instance.getRoleSampleBySid(item.sid);

        itemName.text = sample.name;

        string count;

        if (item.num == 0)
        {
            count = "x1";
        }
        else
        {
            count = "x" + item.num;
        }

        itemName.text       += count;
        itemImage.width      = 512;
        itemImage.height     = 512;
        qualityBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(sample.qualityId);
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + sample.imageID, itemImage);
        Initialize(ctrl);
    }
コード例 #22
0
    //设置创建按钮信息
    private void updateButton(PrizeSample _prize)
    {
        if (_prize == null)
        {
            return;
        }
        else
        {
            prize = _prize;

            if (backgroud != null)
            {
                backgroud.gameObject.SetActive(false);
            }

            if (itemImage != null)
            {
                itemImage.gameObject.SetActive(false);
            }
            if (num != null)
            {
                num.gameObject.SetActive(true);
                num.text = "X " + prize.num.ToString();
                num.transform.localPosition = new Vector3(num.transform.localPosition.x, -66, num.transform.localPosition.z);
            }
            switch (prize.type)
            {
            //召唤兽
            case PrizeType.PRIZE_BEAST:
                Card beast = CardManagerment.Instance.createCard(prize.pSid);
                if (starPrefab != null)
                {
                    for (int i = 0; i < starPrefab.transform.childCount; i++)
                    {
                        starPrefab.transform.GetChild(i).gameObject.SetActive(false);
                    }
                    for (int i = 0; i < CardSampleManager.Instance.getStarLevel(beast.sid); i++)
                    {
                        starPrefab.transform.GetChild(i).gameObject.SetActive(true);
                    }
                }
                if (itemImage != null)
                {
                    if (CommandConfigManager.Instance.getNvShenClothType() == 0)
                    {
                        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + beast.getImageID() + "c", itemImage);
                    }
                    else
                    {
                        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + beast.getImageID(), itemImage);
                    }
                    itemImage.width  = (int)cardImageSide.x;
                    itemImage.height = (int)cardImageSide.y;
                }
                if (backgroud != null)
                {
                    backgroud.gameObject.SetActive(true);
                    backgroud.spriteName = QualityManagerment.qualityIDToBackGround(beast.getQualityId());
                    backgroud.width      = (int)cardBackgroudSide.x;
                    backgroud.height     = (int)cardBackgroudSide.y;
                }
                break;

            //卡片
            case PrizeType.PRIZE_CARD:
                Card card = CardManagerment.Instance.createCard(prize.pSid);
                if (starPrefab != null)
                {
                    for (int i = 0; i < starPrefab.transform.childCount; i++)
                    {
                        starPrefab.transform.GetChild(i).gameObject.SetActive(false);
                    }
                    for (int i = 0; i < CardSampleManager.Instance.getStarLevel(card.sid); i++)
                    {
                        starPrefab.transform.GetChild(i).gameObject.SetActive(true);
                    }
                }
                if (itemImage != null)
                {
                    ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + card.getImageID(), itemImage);
                    itemImage.width  = (int)cardImageSide.x;
                    itemImage.height = (int)cardImageSide.y;
                }
                if (backgroud != null)
                {
                    backgroud.gameObject.SetActive(true);
                    backgroud.spriteName = QualityManagerment.qualityIDToBackGround(card.getQualityId());
                    backgroud.width      = (int)cardBackgroudSide.x;
                    backgroud.height     = (int)cardBackgroudSide.y;
                }
                if (num != null)
                {
                    num.transform.localPosition = new Vector3(num.transform.localPosition.x, -92, num.transform.localPosition.z);
                }
                break;

            //装备
            case PrizeType.PRIZE_EQUIPMENT:
                Equip equip = EquipManagerment.Instance.createEquip(prize.pSid);
                if (itemImage != null)
                {
                    ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), itemImage);
                    itemImage.width  = (int)equipImageSide.x;
                    itemImage.height = (int)equipImageSide.y;
                }
                if (backgroud != null)
                {
                    backgroud.gameObject.SetActive(true);
                    backgroud.spriteName = QualityManagerment.qualityIDToIconSpriteName(equip.getQualityId());
                    backgroud.width      = (int)equipBackgroudSide.x;
                    backgroud.height     = (int)equipBackgroudSide.y;
                }
                break;

            case PrizeType.PRIZE_MONEY:
                if (itemImage != null)
                {
                    backgroud.gameObject.SetActive(true);
                    backgroud.spriteName = QualityManagerment.qualityIDToIconSpriteName(5);
                    backgroud.width      = (int)equipBackgroudSide.x;
                    backgroud.height     = (int)equipBackgroudSide.y;
                    ResourcesManager.Instance.LoadAssetBundleTexture(prize.getIconPath(), itemImage);
                    itemImage.width  = (int)propImageSide.x;
                    itemImage.height = (int)propImageSide.y;
                }
                break;

            //道具
            case PrizeType.PRIZE_PROP:
                Prop prop = PropManagerment.Instance.createProp(prize.pSid);
                if (itemImage != null)
                {
                    ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + prop.getIconId(), itemImage);
                    itemImage.width  = (int)propImageSide.x;
                    itemImage.height = (int)propImageSide.y;
                }
                if (backgroud != null)
                {
                    backgroud.gameObject.SetActive(true);
                    backgroud.spriteName = QualityManagerment.qualityIDToIconSpriteName(prop.getQualityId());
                    backgroud.width      = (int)propBackgroudSide.x;
                    backgroud.height     = (int)propBackgroudSide.y;
                }
                break;

            case PrizeType.PRIZE_RMB:
                if (itemImage != null)
                {
                    backgroud.gameObject.SetActive(true);
                    backgroud.spriteName = QualityManagerment.qualityIDToIconSpriteName(5);
                    backgroud.width      = (int)equipBackgroudSide.x;
                    backgroud.height     = (int)equipBackgroudSide.y;
                    ResourcesManager.Instance.LoadAssetBundleTexture(prize.getIconPath(), itemImage);
                    itemImage.width  = (int)propImageSide.x;
                    itemImage.height = (int)propImageSide.y;
                }
                break;

            case PrizeType.PRIZE_EXP:
                if (itemImage != null)
                {
                    ResourcesManager.Instance.LoadAssetBundleTexture(prize.getIconPath(), itemImage);
                    itemImage.width  = (int)propImageSide.x;
                    itemImage.height = (int)propImageSide.y;
                }
                break;
            }
        }
    }
コード例 #23
0
    public void updateGoods(Goods goods, CallBack callback, int intoType)
    {
        this.intoType   = intoType;
        this.goods      = goods;
        this.shopUpdate = callback;
        if (stars != null)
        {
            for (int i = 0; i < stars.transform.childCount; i++)
            {
                stars.transform.GetChild(i).gameObject.SetActive(false);
            }
        }
        if (goods.getShowTime() != "")
        {
            buyTime.text = goods.getShowTime();
            buyTime.gameObject.SetActive(true);
            timer = TimerManager.Instance.getTimer(UserManager.TIMER_DELAY);
            timer.addOnTimer(showTime);
            timer.start();
        }
        else
        {
            buyTime.gameObject.SetActive(false);
        }
        timePoint.SetActive(true);
        if (intoType == MERIT_SHOP)
        {
            costIcon.spriteName = "icon_gongxun";
            timePoint.SetActive(true);
        }
        else if (intoType == LASTBATTLESHOP)
        {
            costIcon.spriteName = "icon_junGong";
            //timePoint.SetActive(false);
        }
        else if (intoType == GUILDSHOP)
        {
            costIcon.spriteName = "Contribution";
            showNum.text        = "";//把数据清零
            if (goods.getGoodsShowNum() > 1)
            {
                showNum.gameObject.SetActive(true);
                showNum.text = "x" + goods.getGoodsShowNum();
            }
        }
        else if (intoType == SUPERDRAWSHOP)
        {
            buyButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("superDraw_09");
            costIcon.spriteName      = "jiangjuan";
            costIcon.gameObject.SetActive(true);
            costIcon.transform.localScale    = new Vector3(0.7f, 0.7f, 1f);
            costIcon.transform.localPosition = new Vector3(34.0f, 0, 0);
            showNum.text = "";//把数据清零
            if (goods.getGoodsShowNum() > 1)
            {
                showNum.gameObject.SetActive(true);
                showNum.text = "x" + goods.getGoodsShowNum();
            }
        }
        else if (intoType == LADDER_HEGOMENOY)
        {
            ladderHeSetting.showPointLabel.gameObject.SetActive(true);
            ladderHeSetting.hideSprite.gameObject.SetActive(false);
            ladderHeSetting.showLimitLabel.gameObject.SetActive(true);
            ladderHeSetting.showLimitLabel.text = "X" + goods.getGoodsShowNum();
        }

        if (goods.getGoodsMaxBuyCount() > 0 && goods.getNowBuyNum() >= goods.getGoodsMaxBuyCount())
        {
            buyButton.disableButton(true);
            goodsNum.text = LanguageConfigManager.Instance.getLanguage("Guild_96");
        }
        else
        {
            buyButton.disableButton(false);
            if (intoType == MERIT_SHOP)
            {
                if (UserManager.Instance.self.getUserLevel() < goods.getLimitLevel &&
                    UserManager.Instance.self.vipLevel < goods.getVipLimitLevel)
                {
                    buyButton.disableButton(true);
                    buyButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_028",
                                                                                          goods.getLimitLevel + "", goods.getVipLimitLevel + "");
                }
                else
                {
                    buyButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0014");
                }
            }
            buyButton.goods        = this.goods;
            buyButton.callback     = buy;
            buyButton.fatherWindow = fatherWindow;
            if (goods.getGoodsMaxBuyCount() == 0)
            {
                if (intoType == SUPERDRAWSHOP)
                {
                    goodsNum.text = LanguageConfigManager.Instance.getLanguage("superDraw_11");
                }
                else
                {
                    goodsNum.text = LanguageConfigManager.Instance.getLanguage("s0280l1");
                }
            }
            else
            {
                if (intoType == SUPERDRAWSHOP)
                {
                    int lastNum = Math.Max(goods.getGoodsMaxBuyCount() - goods.getNowBuyNum(), 0);
                    goodsNum.text = LanguageConfigManager.Instance.getLanguage("superDraw_10", lastNum.ToString(), goods.getGoodsMaxBuyCount().ToString());
                }
                else
                {
                    int lastNum = Math.Max(goods.getGoodsMaxBuyCount() - goods.getNowBuyNum(), 0);
                    goodsNum.text = LanguageConfigManager.Instance.getLanguage("s0280l0", lastNum.ToString(), goods.getGoodsMaxBuyCount().ToString());
                }
            }
        }
        string des       = "";
        string nameColor = "";

        if ((goods.isScrap()) &&
            goods.getGoodsShopType() == ShopType.LADDER_HEGOMONEY)
        {
            ladderHeSetting.scrapSprite.gameObject.SetActive(true);
        }
        if (goods.getGoodsType() == PrizeType.PRIZE_EQUIPMENT)
        {
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(EquipmentSampleManager.Instance.getEquipSampleBySid(goods.getGoodsSid()).qualityId);
            des       = EquipmentSampleManager.Instance.getEquipSampleBySid(goods.getGoodsSid()).desc;
            nameColor = QualityManagerment.getQualityColor(EquipmentSampleManager.Instance.getEquipSampleBySid(goods.getGoodsSid()).qualityId);
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_PROP)
        {
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).qualityId);
            des       = PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).describe;
            nameColor = QualityManagerment.getQualityColor(PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).qualityId);

            if (goods.isCardScrap() && stars != null)  //如果是卡片碎片,显示星星
            {
                stars.transform.localPosition = new Vector3(0, -30, 0);
                int  propSid = PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).sid;
                Card card    = CardScrapManagerment.Instance.getCardByScrapSid(propSid);//根据卡片碎片id获取对应卡片
                if (card != null && CardSampleManager.Instance.getStarLevel(card.sid) != null)
                {
                    int cardStarLevel = CardSampleManager.Instance.getStarLevel(card.sid);//卡片星级
                    showStar(cardStarLevel);
                }
            }
            else if (goods.isMagicScrap() && stars != null)
            {
                stars.transform.localPosition = new Vector3(0, -30, 0);
                int         propSid = PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).sid;
                MagicWeapon magic   = MagicWeaponScrapManagerment.Instance.getMagicWeaponByScrapSid(propSid);
                if (magic != null && MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magic.sid) != null)
                {
                    int level = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magic.sid).starLevel;
                    showStar(level);
                }
            }
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_STARSOUL)
        {
            CreateStarSoulItem(goods.getGoodsSid());
            des       = StarSoulManager.Instance.createStarSoul(goods.getGoodsSid()).getDescribe();
            nameColor = QualityManagerment.getQualityColor(StarSoulManager.Instance.createStarSoul(goods.getGoodsSid()).getQualityId());
        }
        if (spriteScrap != null)
        {
            if (goods.isScrap())
            {
                spriteScrap.gameObject.SetActive(true);
            }
            else
            {
                spriteScrap.gameObject.SetActive(false);
            }
        }
        showGoodsTex();
        if (goods.getGoodsShopType() == ShopType.LADDER_HEGOMONEY)
        {
            topLabel.text = nameColor + goods.getName();
        }
        else
        {
            topLabel.text = goods.getName();
        }

        des = des.Split('~') [0];
        Regex           r     = new Regex("\\[.+?\\]");
        MatchCollection mc    = r.Matches(des);
        int             index = 0;

        for (int i = 0; i < mc.Count; i++)
        {
            if (mc [i].Index > STRING_LENGTH - 1)
            {
                break;
            }
            else if (mc [i].Index <= STRING_LENGTH - 1 && mc [i].Index + mc [i].Value.Length > STRING_LENGTH)
            {
                index += mc [i].Value.Length;
                break;
            }
            else
            {
                index += mc [i].Value.Length;
            }
        }
        if (des.Length > (STRING_LENGTH + index))
        {
            des = des.Substring(0, STRING_LENGTH - 1 + index) + "...";
        }
        if (infoDec != null)
        {
            infoDec.text = des;
        }
        if (intoType == LADDER_HEGOMENOY)
        {
            bottomLabel.text = goods.getCostPrice().ToString();
        }
        else if (intoType == SUPERDRAWSHOP)
        {
            bottomLabel.text = goods.getCostPrice().ToString();
            bottomLabel.transform.localPosition = new Vector3(71.0f, -3.0f, 0);
        }
        else
        {
            if (fatherWindow is GuildShopWindow)
            {
                bottomLabel.text = LanguageConfigManager.Instance.getLanguage("Guild_1114", goods.getCostPrice().ToString());
            }
            else
            {
                bottomLabel.text = goods.getCostPrice().ToString();
            }
        }
    }
コード例 #24
0
    public void UpdateEquip(Equip _equip, int type)
    {
        this.type = type;
        equip     = _equip;
        if (equip.equpStarState > 0)
        {
            starLevel.gameObject.SetActive(true);
            starLevel.text = "+" + equip.equpStarState.ToString();
        }
        else
        {
            starLevel.gameObject.SetActive(false);
        }
        intensifyButton.UpdateEquip(_equip);

        if (type == ContentEquipChoose.INTENSIFY)
        {
            intensifyButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0012");
            if (equip.getLevel() >= equip.getMaxLevel())
            {
                intensifyButton.gameObject.SetActive(false);
            }
            else
            {
                //新手引导等级指引开始前不开放
                if (GuideManager.Instance.isLessThanStep(124002000))
                {
                    intensifyButton.gameObject.SetActive(false);
                }
                else
                {
                    intensifyButton.gameObject.SetActive(true);
                }
            }
        }
        else if (type == ContentEquipChoose.PUT_ON)
        {
            intensifyButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0013");
        }
        else if (type == ContentEquipChoose.CHATSHOW)
        {
            intensifyButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0308");
        }
        else if (type == ContentEquipChoose.FROM_TO_UPSTAR)
        {
            intensifyButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("equipStar02");
        }
        else
        {
            throw new Exception(GetType() + "UpdateEquip type error! type=" + type);
        }

        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), itemIcon);
        EquipManagerment.Instance.stateIDToString(equip.getState());
        equipName.text = QualityManagerment.getQualityColor(equip.getQualityId()) + equip.getName();
        if (equipLv != null)
        {
            equipLv.text = "Lv." + equip.getLevel();
        }
        AttrChange[] attrs = equip.getAttrChanges();
        if (attrs != null && attrs.Length > 0 && attrs [0] != null)
        {
            equipAttribute.text = attrs [0].typeToString();
            if (equipAttributeValue != null)
            {
                equipAttributeValue.text = "+" + attrs [0].num;
            }
        }
        quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(equip.getQualityId());
        int isstateId;

        isstateId = EquipManagerment.Instance.stateIDToString(equip.getState());
        //state.text = EquipManagerment.Instance.stateIDToString (equip.getState ());
        if (isstateId == 1)
        {
            isstate.gameObject.SetActive(true);
        }
        else
        {
            isstate.gameObject.SetActive(false);
        }
        int refinelevel = equip.getrefineLevel();

        if (refinelevel == 0)
        {
            state.gameObject.SetActive(false);
        }
        else
        {
            state.gameObject.SetActive(true);
            state.text = LanguageConfigManager.Instance.getLanguage("refine_031", refinelevel.ToString());
        }
        if (equip.isNew)
        {
            if (isNew != null && !isNew.gameObject.activeSelf)
            {
                isNew.gameObject.SetActive(true);
            }
        }
        else if (isNew != null && isNew.gameObject.activeSelf)
        {
            isNew.gameObject.SetActive(false);
        }
    }
コード例 #25
0
    public void updateEquip(Equip item)
    {
        if (gameObject.GetComponent <iTween>())
        {
            DestroyImmediate(gameObject.GetComponent <iTween>());
        }
        iTween.Stop(gameObject, true);
        canStar = false;
        equip   = item;
        if (equip != null)
        {
            if (equip.equpStarState > 0)
            {
                starLevelState.text = equip.equpStarState + LanguageConfigManager.Instance.getLanguage("star_star_star");
                starflag            = true;
            }
            else
            {
                starflag            = false;
                starLevelState.text = "";
                starLevelState.gameObject.SetActive(false);
            }
            if (equip.getrefineLevel() > 0)
            {
                reflag        = true;
                renLevel.text = equip.getrefineLevel() + LanguageConfigManager.Instance.getLanguage("refine_024");
            }
            else
            {
                reflag = false;
                renLevel.gameObject.SetActive(false);
                renLevel.text = "";
            }
            iconImage.gameObject.SetActive(true);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(),
                                                             iconImage);
            backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(equip.getQualityId());
            equipLv.text          = "Lv" + equip.getLevel();
        }
        else
        {
            reflag   = false;
            starflag = false;
            renLevel.gameObject.SetActive(false);
            starLevelState.gameObject.SetActive(false);
            backGround.spriteName = orgSpriteName;
            iconImage.gameObject.SetActive(false);
            starLevelState.text = "";
            equipLv.text        = "";
            renLevel.text       = "";
        }
        canStar = false;
        if (equip != null && timer == null)
        {
            timer = TimerManager.Instance.getTimer(1000);
            timer.addOnTimer(refreshData);
            timer.start();
        }

        updateStatus();
        // showStarEffect();
    }
コード例 #26
0
    public void Initialize(Prop chooseItem, int index, int intoType)
    {
        localIndex  = index;
        chooseProp  = chooseItem;
        intoWinType = intoType;
        nextProp    = chooseProp;
        for (int i = 0; i < CostInfoLabels.Length; i++)
        {
            CostInfoLabels[i].text = "";
        }
        if (ShenGeManager.Instance.getShowShenGeList(chooseProp).Count > 0)
        {
            buttonChange.disableButton(false);
        }
        else
        {
            buttonChange.disableButton(true);
        }
        if (chooseProp != null)
        {
            if (intoType == ShenGeManager.STORAGE)
            {
                buttonChange.gameObject.SetActive(false);
                buttonGroup.gameObject.SetActive(false);
            }
            else if (intoType == ShenGeManager.SHENGEWINDOW)
            {
                buttonCompound.gameObject.SetActive(false);
            }
            string str = "";
            switch (chooseProp.getType())
            {
            case PropType.PROP_SHENGE_HP:
                str = LanguageConfigManager.Instance.getLanguage("s0005");
                break;

            case PropType.PROP_SHENGE_ATT:
                str = LanguageConfigManager.Instance.getLanguage("s0006");
                break;

            case PropType.PROP_SHENGE_DEF:
                str = LanguageConfigManager.Instance.getLanguage("s0007");
                break;

            case PropType.PROP_SHENGE_MAG:
                str = LanguageConfigManager.Instance.getLanguage("s0008");
                break;

            case PropType.PROP_SHENGE_AGI:
                str = LanguageConfigManager.Instance.getLanguage("s0009");
                break;
            }
            valueType.text       = str;
            currentPropName.text = QualityManagerment.getQualityColor(chooseProp.getQualityId()) + chooseProp.getName();
            if (!ShenGeManager.Instance.checkCanGroup(chooseProp, intoType))
            {
                DescribeLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_022");
                PropSample tmpSample = PropSampleManager.Instance.getPropSampleBySid(chooseProp.getNextShenGeSid());
                if (tmpSample == null)
                {
                    DescribeLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_030");
                    desc.text          = "";
                }
                else
                {
                    nextProp  = PropManagerment.Instance.createProp(tmpSample.sid);
                    desc.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_038");
                }
                ResourcesManager.Instance.LoadAssetBundleTexture(
                    ResourcesManager.ICONIMAGEPATH + chooseProp.getIconId(), propImage);
                //propName.text = QualityManagerment.getQualityColor(chooseProp.getQualityId()) + chooseProp.getName();
                //propName.gameObject.transform.localPosition = new Vector3(130,23.5f,0);
                propName.text      = "";
                heChengLabel.text  = "";
                quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(chooseProp.getQualityId());
                ValueLabel.text    = chooseProp.getEffectValue() + "";
                addValueLabel.text = "";
                buttonGroup.disableButton(true);
                return;
            }
            buttonGroup.disableButton(false);
            PropSample sample = PropSampleManager.Instance.getPropSampleBySid(chooseProp.getNextShenGeSid());
            if (sample == null)
            {
                return;
            }
            else
            {
                nextProp = PropManagerment.Instance.createProp(sample.sid);
            }
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + sample.iconId, propImage);
            heChengLabel.text = LanguageConfigManager.Instance.getLanguage("NvShenShenGe_021");
            propName.text     = QualityManagerment.getQualityColor(sample.qualityId) + sample.name;
            propName.gameObject.transform.localPosition = new Vector3(183, 23.5f, 0);
            quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(sample.qualityId);
            ValueLabel.text    = chooseProp.getEffectValue() + "";
            addValueLabel.text = "+" + (sample.effectValue - chooseProp.getEffectValue()) + "";
            List <ShenGeInfo> tmpList = ShenGeManager.Instance.shengeList;
            for (int i = 0; i < tmpList.Count; i++)
            {
                Prop tmpProp = PropManagerment.Instance.createProp(tmpList[i].sid);
                if (tmpProp != null)
                {
                    CostInfoLabels[i].text = QualityManagerment.getQualityColor(tmpProp.getQualityId()) + tmpProp.getName() + "X" + tmpList[i].num;
                }
            }
        }
    }
コード例 #27
0
    public void updateGoods(Goods goods, CallBack callback, int intoType)
    {
        this.intoType   = intoType;
        this.goods      = goods;
        this.shopUpdate = callback;
        updateConstIcon();         //更新花费类型图标
        buyButton.disableButton(false);
        buyButton.goods        = this.goods;
        buyButton.callback     = buy;
        buyButton.fatherWindow = fatherWindow;
        updateIsBuyState();
        updateByButtonState();
        string nameColor = "";

        if (goods.getGoodsType() == PrizeType.PRIZE_EQUIPMENT)
        {
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(EquipmentSampleManager.Instance.getEquipSampleBySid(goods.getGoodsSid()).qualityId);
            nameColor = QualityManagerment.getQualityColor(EquipmentSampleManager.Instance.getEquipSampleBySid(goods.getGoodsSid()).qualityId);
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_PROP)
        {
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).qualityId);
            nameColor = QualityManagerment.getQualityColor(PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).qualityId);
            if (goods.isCardScrap() && stars != null)  //如果是卡片碎片,显示星星
            {
                stars.transform.localPosition = new Vector3(0, -30, 0);
                int  propSid       = PropSampleManager.Instance.getPropSampleBySid(goods.getGoodsSid()).sid;
                Card card          = CardScrapManagerment.Instance.getCardByScrapSid(propSid); //根据卡片碎片id获取对应卡片
                int  cardStarLevel = CardSampleManager.Instance.getStarLevel(card.sid);        //卡片星级
                for (int i = 0; i < cardStarLevel; i++)
                {
                    stars.transform.GetChild(i).gameObject.SetActive(true);
                }
                if (cardStarLevel == CardSampleManager.ONESTAR)
                {
                    stars.transform.localPosition = new Vector3(33, -30, 0);
                }
                else if (cardStarLevel == CardSampleManager.TWOSTAR)
                {
                    stars.transform.localPosition = new Vector3(22, -30, 0);
                }
                else if (cardStarLevel == CardSampleManager.THREESTAR)
                {
                    stars.transform.localPosition = new Vector3(11, -30, 0);
                }
                else if (cardStarLevel == CardSampleManager.FOURSTAR)
                {
                    stars.transform.localPosition = new Vector3(0, -30, 0);
                }
            }
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_CARD)
        {
            icon_backGround.spriteName = QualityManagerment.qualityIDToIconSpriteName(CardSampleManager.Instance.getRoleSampleBySid(goods.getGoodsSid()).qualityId);
            if (stars != null)  //如果是卡片,显示星星
            {
                stars.transform.localPosition = new Vector3(0, -30, 0);
                CardSample card          = CardSampleManager.Instance.getRoleSampleBySid(goods.getGoodsSid()); //根据id获取对应卡片
                int        cardStarLevel = CardSampleManager.Instance.getStarLevel(card.sid);                  //卡片星级
                for (int i = 0; i < cardStarLevel; i++)
                {
                    stars.transform.GetChild(i).gameObject.SetActive(true);
                }
                if (cardStarLevel == CardSampleManager.ONESTAR)
                {
                    stars.transform.localPosition = new Vector3(33, -30, 0);
                }
                else if (cardStarLevel == CardSampleManager.TWOSTAR)
                {
                    stars.transform.localPosition = new Vector3(22, -30, 0);
                }
                else if (cardStarLevel == CardSampleManager.THREESTAR)
                {
                    stars.transform.localPosition = new Vector3(11, -30, 0);
                }
                else if (cardStarLevel == CardSampleManager.FOURSTAR)
                {
                    stars.transform.localPosition = new Vector3(0, -30, 0);
                }
            }
            //des=CardSampleManager.Instance.getRoleSampleBySid (goods.getGoodsSid ()).d;
        }
        else if (goods.getGoodsType() == PrizeType.PRIZE_STARSOUL)
        {
            nameColor = QualityManagerment.getQualityColor(StarSoulManager.Instance.createStarSoul(goods.getGoodsSid()).getQualityId());
        }
        if (spriteScrap != null)
        {
            if (goods.isScrap() && goods.getOfferNum() <= 0)
            {
                spriteScrap.gameObject.SetActive(true);
            }
            else
            {
                spriteScrap.gameObject.SetActive(false);
            }
        }
        showGoodsTex();
        if (nameColor != "" && isNameColor)
        {
            topLabel.text = goods.getName();
        }
        else
        {
            topLabel.text = goods.getName();
        }
        propNum.text = "x " + goods.getGoodsShowNum();
        int maxNumm = GoodsBuyCountManager.Instance.getMaxNum(goods.sid);

        buyCount.text = LanguageConfigManager.Instance.getLanguage("s0151") + ":" + (maxNumm - (goods.nowBuyNum)) + "/" + maxNumm.ToString();
    }
コード例 #28
0
    public void updateButton(ExchangeCondition condition, int type)
    {
        cleanData();
        Image.gameObject.SetActive(true);
        this.type = type;

        if (condition.costType == PrizeType.PRIZE_CARD)
        {
            Card showCard = CardManagerment.Instance.createCard(condition.costSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + showCard.getImageID(), Image);

            if (type == EXCHANGE)
            {
                Image.width  = (int)bigPic.x;
                Image.height = (int)bigPic.y;
            }
            else
            {
                Image.width  = (int)bigPic.x;
                Image.height = (int)bigPic.y;
            }
            icon_back.gameObject.SetActive(true);
            icon_back.width      = (int)bigPicBg.x;
            icon_back.height     = (int)bigPicBg.y;
            icon_back.spriteName = QualityManagerment.qualityIDToBackGround(showCard.getQualityId());
            setNormalSprite(icon_back.spriteName);
            ArrayList list = StorageManagerment.Instance.getNoUseRolesBySid(condition.costSid);

            if (list.Count >= condition.num)
            {
                textLabel.color = Color.green;
            }
            else
            {
                textLabel.color = Color.red;
            }

            textLabel.text = list.Count + "/" + condition.num;
            item           = showCard;
        }
        else if (condition.costType == PrizeType.PRIZE_EQUIPMENT)
        {
            Equip showEquip = EquipManagerment.Instance.createEquip(condition.costSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + showEquip.getIconId(), Image);
            Image.width  = (int)smallPic.x;
            Image.height = (int)smallPic.y;
            icon_back.gameObject.SetActive(true);
            icon_back.width      = (int)iconPic.x;
            icon_back.height     = (int)iconPic.y;
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(showEquip.getQualityId());
            setNormalSprite(icon_back.spriteName);
            ArrayList list = StorageManagerment.Instance.getEquipsBySid(condition.costSid);
            textLabel.text = list.Count + "/" + condition.num;

            if (list.Count >= condition.num)
            {
                textLabel.color = Color.green;
            }
            else
            {
                textLabel.color = Color.red;
            }
            item = showEquip;
        }
        else if (condition.costType == PrizeType.PRIZE_PROP)
        {
            Prop showProp = PropManagerment.Instance.createProp(condition.costSid);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + showProp.getIconId(), Image);
            Image.width  = (int)smallPic.x;
            Image.height = (int)smallPic.y;
            icon_back.gameObject.SetActive(true);
            icon_back.width      = (int)iconPic.x;
            icon_back.height     = (int)iconPic.y;
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(showProp.getQualityId());
            setNormalSprite(icon_back.spriteName);
            ArrayList list = StorageManagerment.Instance.getPropsBySid(condition.costSid);

            int count = 0;
            foreach (Prop each in list)
            {
                count += each.getNum();
            }

            textLabel.text = count + "/" + condition.num;

            if (count >= condition.num)
            {
                textLabel.color = Color.green;
            }
            else
            {
                textLabel.color = Color.red;
            }

            item = showProp;
        }
        else if (condition.costType == PrizeType.PRIZE_MONEY)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.MONEY_ICONPATH, Image);
            Image.width      = (int)smallPic.x;
            Image.height     = (int)smallPic.y;
            icon_back.width  = (int)iconPic.x;
            icon_back.height = (int)iconPic.y;
            icon_back.gameObject.SetActive(true);
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(5);
            setNormalSprite(icon_back.spriteName);
            int count = UserManager.Instance.self.getMoney();
            textLabel.text = "x" + condition.num;

            if (count >= condition.num)
            {
                textLabel.color = Color.green;
            }
            else
            {
                textLabel.color = Color.red;
            }

            item = PrizeType.PRIZE_MONEY;
        }
        else if (condition.costType == PrizeType.PRIZE_RMB)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.RMB_ICONPATH, Image);
            Image.width      = (int)smallPic.x;
            Image.height     = (int)smallPic.y;
            icon_back.width  = (int)iconPic.x;
            icon_back.height = (int)iconPic.y;
            icon_back.gameObject.SetActive(true);
            int count = UserManager.Instance.self.getRMB();
            textLabel.text = "x" + condition.num;

            if (count >= condition.num)
            {
                textLabel.color = Color.green;
            }
            else
            {
                textLabel.color = Color.red;
            }

            item = PrizeType.PRIZE_RMB;
        }
        else if (condition.costType == PrizeType.PRIZE_MERIT)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(constResourcesPath.MERIT_ICONPATH, Image);
            Image.width      = (int)smallPic.x;
            Image.height     = (int)smallPic.y;
            icon_back.width  = (int)iconPic.x;
            icon_back.height = (int)iconPic.y;
            icon_back.gameObject.SetActive(true);
            icon_back.spriteName = QualityManagerment.qualityIDToIconSpriteName(5);
            setNormalSprite(icon_back.spriteName);
            int count = UserManager.Instance.self.merit;
            textLabel.text = "x" + condition.num;

            if (count >= condition.num)
            {
                textLabel.color = Color.green;
            }
            else
            {
                textLabel.color = Color.red;
            }

            item = PrizeType.PRIZE_MERIT;
        }
    }
コード例 #29
0
    public void initRefine(WindowBase wb, Equip eq, int part, int showType)
    {
        selectEquip = eq;
        clickButton.fatherWindow = wb;
        showTypeNum = showType;
        if (eq == null)
        {
            eqName.text = LanguageConfigManager.Instance.getLanguage("resonanceWindow02");
            eqIcon.gameObject.SetActive(false);
            eqbg.gameObject.SetActive(false);
            lvBar.updateValue(0, 1);
            eqlLabel.text = "";
            clickButton.disableButton(false);//点击事件和装备强化界面绑定

            partt.gameObject.SetActive(true);
            if (part == EquipPartType.WEAPON)
            {
                partt.spriteName = "icon_back_weapon";
            }
            else if (part == EquipPartType.ARMOUR)
            {
                partt.spriteName = "icon_back_armor";
            }
            else if (part == EquipPartType.SHOSE)
            {
                partt.spriteName = "icon_back_shose";
            }
            else if (part == EquipPartType.HELMET)
            {
                partt.spriteName = "icon_back_hat";
            }
            else if (part == EquipPartType.RING)
            {
                partt.spriteName = "icon_back_ring";
            }
            if (showTypeNum == CardBookWindow.CLICKCHATSHOW)
            {
                clickButton.disableButton(true);
                this.transform.FindChild("button").gameObject.GetComponent <Collider>().enabled = false;
            }
            else
            {
                clickButton.onClickEvent = intoNoShowInf;
            }
        }
        else
        {
            partt.gameObject.SetActive(false);
            eqIcon.gameObject.SetActive(true);
            eqbg.gameObject.SetActive(true);
            eqName.text = QualityManagerment.getQualityColor(selectEquip.getQualityId()) + selectEquip.getName();
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + selectEquip.getIconId(), eqIcon);
            eqbg.spriteName = QualityManagerment.qualityIDToIconSpriteName(selectEquip.getQualityId());
            lvBar.updateValue(selectEquip.getrefineLevel(), selectEquip.getRefineMaxLevel());
            eqlLabel.text = selectEquip.getrefineLevel() + "/" + selectEquip.getRefineMaxLevel();
            clickButton.disableButton(false);
            if (showTypeNum == CardBookWindow.CLICKCHATSHOW)
            {
                clickButton.disableButton(true);
                this.transform.FindChild("button").gameObject.GetComponent <Collider>().enabled = false;
            }
            else
            {
                clickButton.onClickEvent = intoShowRefineInfo;//点击事件和装备强化界面绑定
            }
        }
    }
コード例 #30
0
 public void updateEquip()
 {
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + selectedEquip.getIconId(), equipImage);
     quality.spriteName = QualityManagerment.qualityIDToIconSpriteName(selectedEquip.getQualityId());
     equipName.text     = selectedEquip.getName();
 }