コード例 #1
0
    //设置创建按钮信息
    private void setCreatButton(PrizeSample _prize)
    {
        if (_prize == null)
        {
            return;
        }
        else
        {
            prize = _prize;
            icon.gameObject.SetActive(false);
            back.spriteName = QualityManagerment.qualityIDToIconSpriteName(_prize.getQuality());
            spObj.SetActive(false);
            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);
                if (prop.isCardScrap() || prop.isEquipScrap() || prop.isScrap())
                {
                    spObj.SetActive(true);
                }
                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;

            case PrizeType.PRIZE_CARD:
                Card card = CardManagerment.Instance.createCard(prize.pSid);
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + card.getIconID(), icon);
                num.text = "x" + prize.num.ToString();
                break;

            case PrizeType.PRIZE_EQUIPMENT:
                Equip equip = EquipManagerment.Instance.createEquip(prize.pSid);
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), icon);
                num.text = "x" + prize.num.ToString();
                break;

            case PrizeType.PRIZE_STARSOUL:
                StarSoul starsoulView = StarSoulManager.Instance.createStarSoul(prize.pSid);
                Utils.DestoryChilds(icon.gameObject);
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.STARSOUL_ICONPREFAB_PATH + starsoulView.getIconId(), icon.transform, (obj) => {
                    GameObject gameObj = obj as GameObject;
                    if (gameObj != null)
                    {
                        Transform childTrans  = gameObj.transform;
                        childTrans.localScale = new Vector3(0.7f, 0.7f, 1);
                        if (childTrans != null)
                        {
                            StarSoulEffectCtrl _effectCtrl = childTrans.gameObject.GetComponent <StarSoulEffectCtrl>();
                            _effectCtrl.setColor(starsoulView.getQualityId());
                        }
                    }
                });
                num.text = "x" + prize.num.ToString();
                break;

            case PrizeType.PRIZE_MAGIC_WEAPON:
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(prize.pSid).iconId, icon);
                num.text = "x" + prize.num.ToString();
                break;
            }
            icon.gameObject.SetActive(true);
        }
    }
コード例 #2
0
    /// <summary>
    /// 更新星魂信息
    /// </summary>
    public void updateStarSoul()
    {
        levelValueLabel.text   = starSoul.getLevel() + "/" + starSoul.getMaxLevel();
        starSoulNameLabel.text = QualityManagerment.getQualityColor(starSoul.getQualityId()) + starSoul.getName();
        long currentLvExp    = EXPSampleManager.Instance.getNowEXPShow(starSoul.getEXPSid(), starSoul.getEXP());
        long currentLvMaxEXP = EXPSampleManager.Instance.getMaxEXPShow(starSoul.getEXPSid(), starSoul.getEXP());

        if (starSoul.isMaxLevel())
        {
            expBar.updateValue(currentLvMaxEXP, currentLvMaxEXP);
        }
        else
        {
            expBar.updateValue(currentLvExp, currentLvMaxEXP);
        }
        expLabel.text = EXPSampleManager.Instance.getExpBarShow(starSoul.getEXPSid(), starSoul.getEXP());
        if (starSoul.checkState(EquipStateType.LOCKED))
        {
            lockSprite.gameObject.SetActive(true);
        }
        else
        {
            lockSprite.gameObject.SetActive(false);
        }
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.STARSOUL_ICONPREFAB_PATH + starSoul.getIconId(), starSoulViewPoint.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(starSoul.getQualityId());
                }
            }
        });
        string[] str = starSoul.getDescribe().Split('#');
        if (str.Length > 1)
        {
            attrDescLabel.text  = "[A65644]" + str[0].Replace("+", "[3A9663]+");
            attrDescLabel1.text = "[A65644]" + str[1].Replace("+", "[3A9663]+");
        }
        else
        {
            attrDescLabel1.text = "[A65644]" + str[0].Replace("+", "[3A9663]+");
        }
        int partNum = 0;

        if (currentCard != null)
        {
            partNum = currentCard.getStarSoulsPartNum(starSoul.partId);
        }
        // 刻印暂时没有开放
//		StarSoulSuitSample starSoulSuitSample=starSoul.getStarSoulSuitSample ();
//		int needNum = starSoulSuitSample.parts.Length;
//		if (partNum>=needNum) {
//			// 策划文档上还有个龙之刻印:2分是什么东西???
//			suitDescLabel.text = "[FFFFFF]"+starSoulSuitSample.name+": "+starSoulSuitSample.desc;
//		} else {
//			suitDescLabel.text = "[999999]"+starSoulSuitSample.name+"("+LanguageConfigManager.Instance.getLanguage("StarSoulWindow_Suit_NotAcitve")+"): "+starSoulSuitSample.desc+"("+
//									LanguageConfigManager.Instance.getLanguage("StarSoulWindow_Suit_Acitve_Desc",needNum.ToString())+")";
//		}
    }
コード例 #3
0
 /**  更新星魂视图 */
 private void UpdateStarSoulView(StarSoul starsoulView)
 {
     if (customIconPoint == null)
     {
         return;
     }
     backGround.spriteName = "iconback_3";
     icon.gameObject.SetActive(false);
     customIconPoint.SetActive(true);
     if (customIconPoint.transform.childCount > 0)
     {
         Utils.RemoveAllChild(customIconPoint.transform);
     }
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.STARSOUL_ICONPREFAB_PATH + starsoulView.getIconId(), customIconPoint.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());
             }
         }
     });
     if (starsoulView.isNew)
     {
         spriteScrap.gameObject.SetActive(true);
         if (fatherWindow.name == "StarSoulWindow")
         {
             spriteScrap.transform.localPosition = new Vector3(-48f, 67f, 0);
             spriteScrap.width  = 65;
             spriteScrap.height = 66;
         }
         spriteScrap.spriteName = "new3";
     }
     else
     {
         spriteScrap.gameObject.SetActive(false);
     }
     if (starsoulView.checkState(EquipStateType.LOCKED))
     {
         if (rightBottomSprite != null)
         {
             rightBottomSprite.gameObject.SetActive(true);
             rightBottomSprite.transform.localScale = new Vector3(1, 2, 1);
             rightBottomSprite.spriteName           = "lock";
         }
     }
     else
     {
         if (rightBottomSprite != null)
         {
             rightBottomSprite.gameObject.SetActive(false);
         }
     }
     if (iconType == BOTTOM_TEXT_NAME)
     {
         rightBottomText.gameObject.SetActive(true);
         //rightBottomText.text = QualityManagerment.getQualityColor(starsoulView.getQualityId()) + starsoulView.getName ();
         rightBottomText.text = starsoulView.getName();
     }
     else if (iconType == BOTTOM_TEXT_NAME_LV)
     {
         rightBottomText.gameObject.SetActive(true);
         //rightBottomText.text = QualityManagerment.getQualityColor(starsoulView.getQualityId()) + starsoulView.getName () +"[FFFFFF]"+"Lv."+starsoulView.getLevel();
         rightBottomText.text = starsoulView.getName() + "[FFFFFF]" + "Lv." + starsoulView.getLevel();
     }
     else if (iconType == BOTTOM_TEXT_NUM)
     {
         rightBottomText.gameObject.SetActive(true);
         rightBottomText.text = "x" + count;
     }
     else
     {
         rightBottomText.text = "";
         rightBottomText.gameObject.SetActive(false);
     }
 }