コード例 #1
0
 /// <summary>
 /// 飘红字
 /// </summary>
 private void updateIncNum()
 {
     AttrChangeSample[] oldattrs = oldStarSoul.getAttrChangesByAll();
     AttrChangeSample[] newattrs = starSoul.getAttrChangesByAll();
     string[]           oldNum   = DescribeManagerment.getDescribeParam(oldStarSoul.getLevel(), oldattrs);
     string[]           newNum   = DescribeManagerment.getDescribeParam(starSoul.getLevel(), newattrs);
     TweenLabelNumber[] tlns     = new TweenLabelNumber[newNum.Length];
     for (int i = 0; i < newNum.Length; i++)
     {
         incNumm[i] += StringKit.toInt(newNum[i]) - StringKit.toInt(oldNum[i]);
         addLabels[i].gameObject.SetActive(true);
         addLabels[i].transform.localPosition = starInfo1.transform.localPosition + new Vector3(Math.Max(starInfo1.width, starInfo.width) + 10f, i * (-20f) + 10, 0f);
         incLabels[i].gameObject.SetActive(true);
         incLabels[i].transform.localPosition = addLabels[i].transform.localPosition + new Vector3(addLabels[i].width + 10f, (-3f), 0f);
         if (incNumm[i] > 0)
         {
             tlns[i] = TweenLabelNumber.Begin(incLabels[i].gameObject, 0.5f, incNumm[i]);
             EventDelegate.Add(tlns[i].onFinished, () => {
                 incNumm = new int[3];
                 addLabels[i].gameObject.SetActive(false);
                 incLabels[i].gameObject.SetActive(false);
                 incLabels[i].text = "0";
             }, true);
         }
     }
 }
コード例 #2
0
    /** 更新UI */
    public void updateUI()
    {
        updateLabel();
        updateStarSoulView();
        reserveExp.text = StarSoulManager.Instance.getStarSoulExp().ToString();
        long needExpforOne = starSoul.getEXPUp() - starSoul.getEXP();
        long needExpforAll = starSoul.getMaxExp() - starSoul.getEXP();

        oneLvExp.text   = LanguageConfigManager.Instance.getLanguage("StarSoulStrengWindow_DecThree", needExpforOne.ToString());
        allLVExp.text   = LanguageConfigManager.Instance.getLanguage("StarSoulStrengWindow_DecFour", needExpforAll.ToString());
        expLabel.text   = EXPSampleManager.Instance.getExpBarShow(starSoul.getEXPSid(), starSoul.getEXP());
        starNameLV.text = starSoul.getName() + " Lv." + starSoul.getLevel();
        string[] str = starSoul.getDescribe().Split('#');
        if (str.Length > 1)
        {
            starInfo1.text = str[0].Split('+')[0] + "[3A9663] +" + str[0].Split('+')[1];
            starInfo.text  = str[1].Split('+')[0] + "[3A9663] +" + str[1].Split('+')[1];
        }
        else
        {
            starInfo1.text = str[0].Split('+')[0] + "[3A9663] +" + str[0].Split('+')[1];
        }
        //starInfo.text = starSoul.getDescribe ().Split('+')[0]+"[3A9663] +"+starSoul.getDescribe().Split('+')[1];
        long storeExp = StarSoulManager.Instance.getStarSoulExp();

        if (storeExp == 0 || starSoul.isMaxLevel())
        {
            allUpButton.disableButton(true);
            oneUpButton.disableButton(true);
        }
        else
        {
            // 升一级需要的经验
            long needExp = starSoul.getEXPUp() - starSoul.getEXP();
            if (storeExp < needExp)
            {
                oneUpButton.disableButton(true);
            }
            else
            {
                oneUpButton.disableButton(false);
            }
            allUpButton.disableButton(false);
        }
    }
コード例 #3
0
 /// <summary>
 /// 得到飘字
 /// </summary>
 /// <returns>The star soul dese.</returns>
 /// <param name="starSoul">Star soul.</param>
 public string getStarSoulDese(StarSoul starSoul)
 {
     if (starSoul != null)
     {
         StarSoulSample     starSoulSamle    = starSoul.getStarSoulSample();
         AttrChangeSample[] attrChangeSample = starSoulSamle.getAttrChangeSample();
         return(DescribeManagerment.getDescribe(starSoulSamle.desc, starSoul.getLevel(), attrChangeSample));
     }
     return(null);
 }
コード例 #4
0
    /** 初始化新经验条 */
    private LevelupInfo createLevelupInfo(StarSoul oldStarSoul, StarSoul newStarSoul)
    {
        LevelupInfo levelupInfo = new LevelupInfo();

        levelupInfo.newExp     = newStarSoul.getEXP();
        levelupInfo.newExpDown = EXPSampleManager.Instance.getEXPDown(newStarSoul.getEXPSid(), newStarSoul.getLevel());
        levelupInfo.newExpUp   = EXPSampleManager.Instance.getEXPUp(newStarSoul.getEXPSid(), newStarSoul.getLevel());
        levelupInfo.newLevel   = newStarSoul.getLevel();
        levelupInfo.oldExp     = oldStarSoul.getEXP();
        levelupInfo.oldExpDown = EXPSampleManager.Instance.getEXPDown(oldStarSoul.getEXPSid(), oldStarSoul.getLevel());
        levelupInfo.oldExpUp   = EXPSampleManager.Instance.getEXPUp(oldStarSoul.getEXPSid(), oldStarSoul.getLevel());
        levelupInfo.oldLevel   = oldStarSoul.getLevel();
        return(levelupInfo);
    }
コード例 #5
0
    /** 更新UI */
    public void UpdateIU()
    {
        UpdateButton();
        GameObject obj;

        if (goodsViewPoint.transform.childCount > 0)
        {
            obj = goodsViewPoint.transform.GetChild(0).gameObject;
        }
        else
        {
            obj = NGUITools.AddChild(goodsViewPoint, goodsViewPrefab);
            obj.transform.localScale = new Vector3(0.85f, 0.85f, 1);
        }
        GoodsView gv = obj.GetComponent <GoodsView>();

        gv.setFatherWindow(fatherWindow);
        gv.init(starSoul);
        //starSoulLev.text = QualityManagerment.getQualityColor(starSoul.getQualityId()) + starSoul.getName () + "  Lv." + starSoul.getLevel ();
        //清空属性内容
        infoLabel.text   = "";
        infoLabel1.text  = "";
        starSoulLev.text = starSoul.getName() + "  Lv." + starSoul.getLevel();
        string[] str = starSoul.getDescribe().Split('#');
        if (str.Length > 1)
        {
            infoLabel.text  = "[A65644]" + str[0].Replace("+", "[3A9663]+");
            infoLabel1.text = "[A65644]" + str[1].Replace("+", "[3A9663]+");
        }
        else
        {
            infoLabel1.text = "[A65644]" + str[0].Replace("+", "[3A9663]+");
        }
        bool isPutOn = starSoul.checkState(EquipStateType.OCCUPY);

        if (isPutOn)
        {
            state.text = LanguageConfigManager.Instance.getLanguage("s0017");
        }
        else
        {
            state.text = "";
        }
    }
コード例 #6
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())+")";
//		}
    }
コード例 #7
0
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="wb"></param>
    /// <param name="ss"></param>
    public void init(WindowBase wb, StarSoul ss, Card card, int flag, int currentStarBroe)
    {
        currentcard = card;
        showTypeNum = flag;
        starSoul    = ss;
        clickButton.fatherWindow = wb;
        flagChange = 12;
        this.currentStarBroeIndex = currentStarBroe;
        if (ss == null)
        {
            eqName.text = LanguageConfigManager.Instance.getLanguage("resonanceWindow02");
            //eqbg.gameObject.SetActive(false);
            lvBar.updateValue(0, 1);
            eqlLabel.text = "";
            clickButton.disableButton(true);
            partt.gameObject.SetActive(true);
            if (!StarSoulManager.Instance.checkBroeOpenLev(currentcard, currentStarBroeIndex + 1) && showTypeNum != CardBookWindow.CLICKCHATSHOW)
            {
                lvOpen.gameObject.SetActive(false);
                lvClose.gameObject.SetActive(true);
                unOpenLabel.gameObject.SetActive(true);
                unOpenLabel.text = LanguageConfigManager.Instance.getLanguage("warchoose04", StarSoulConfigManager.Instance.getGrooveOpen()[currentStarBroeIndex].ToString());
            }
            if (showTypeNum == CardBookWindow.CLICKCHATSHOW)
            {
                lvOpen.gameObject.SetActive(true);
                lvClose.gameObject.SetActive(false);
                unOpenLabel.gameObject.SetActive(false);
                clickButton.disableButton(true);
                this.transform.FindChild("button").gameObject.GetComponent <Collider>().enabled = false;
            }
            else
            {
                clickButton.onClickEvent = noStarSoulClick;
            }
        }
        else
        {
            eqName.text = starSoul.getName();
            //eqbg.gameObject.SetActive(true);
            partt.gameObject.SetActive(false);
            lvBar.updateValue(starSoul.getLevel(), starSoul.getMaxLevel());
            eqlLabel.text = starSoul.getLevel() + "/" + starSoul.getMaxLevel();
            clickButton.disableButton(true);
            lvOpen.gameObject.SetActive(false);
            GameObject obj;
            if (viewPoint.transform.childCount > 0)
            {
                obj = viewPoint.transform.GetChild(0).gameObject;
            }
            else
            {
                obj = NGUITools.AddChild(viewPoint, viewPerfabe);
            }
            GoodsView gv = obj.GetComponent <GoodsView>();

            gv.setFatherWindow(clickButton.fatherWindow);
            //gv.onClickCallback = grooveButtonClickHanderr;//点击出问题

            gv.init(starSoul, GoodsView.BOTTOM_TEXT_NAME_LV);
            gv.transform.FindChild("rightBottomText").gameObject.SetActive(false);
            gv.transform.localScale = new Vector3(0.8f, 0.8f, 1);
            //this.transform.FindChild("button").gameObject.GetComponent<Collider>().enabled = false;
            if (showTypeNum == CardBookWindow.CLICKCHATSHOW)
            {
                clickButton.disableButton(true);
                this.transform.FindChild("button").gameObject.GetComponent <Collider>().enabled = false;
            }
            else
            {
                clickButton.onClickEvent = grooveButtonClickHanderr;
            }
        }
    }
コード例 #8
0
    public List <ResonanceSample> getrssList(int type, Card card, long exp, int ii)
    {
        List <ResonanceSample> rssList = new List <ResonanceSample>();

        // ResonanceSample[] teS = new ResonanceSample[2];
        if (type == 1)
        {
            string[] eqStrings = card.getEquips();

            if (eqStrings == null || eqStrings.Length <= 4)//没有产生共鸣
            {
                for (int i = 0; i < eqQHlist.Count; i++)
                {
                    if (eqQHlist[i].needLv < 0)
                    {
                        continue;                        //理论上不存在
                    }
                    if (ii == 0)
                    {
                        rssList.Add(eqQHlist[i]);
                        return(rssList);
                    }
                    rssList.Add(eqQHlist[i < eqQHlist.Count - 1 ? i + 1 : eqQHlist.Count - 1]);
                    return(rssList);
                }
            }
            int templv = -1;
            for (int j = 0; j < eqStrings.Length; j++)
            {
                if (!showTypeNum)
                {
                    Equip eq = StorageManagerment.Instance.getEquip(eqStrings[j]);
                    if (templv == -1 || templv > eq.getLevel())
                    {
                        templv = eq.getLevel();
                    }
                }
                else
                {
                    if (templv == -1 || templv > showChatEquips[j].getLevel())
                    {
                        templv = showChatEquips[j].getLevel();
                    }
                }
            }
            for (int i = 0; i < eqQHlist.Count; i++)
            {
                if (ii == 0) //当前等级
                {
                    if (eqQHlist[i].needLv > templv)
                    {
                        rssList.Add(eqQHlist[i == 0?0:i - 1]);
                        return(rssList);
                    }
                    if (i != eqQHlist.Count - 1 || eqQHlist[i].needLv > templv)
                    {
                        continue;
                    }
                    rssList.Add(eqQHlist[eqQHlist.Count - 1]);
                    return(rssList);
                }
                if (eqQHlist[i].needLv > templv)
                {
                    rssList.Add(eqQHlist[i]);
                    return(rssList);
                }
                if (i != eqQHlist.Count - 1 || eqQHlist[i].needLv > templv)
                {
                    continue;
                }
                rssList.Add(eqQHlist[eqQHlist.Count - 1]);
                return(rssList);
            }
        }
        if (type == 2)
        {
            string[] eqStrings = card.getEquips();
            if (eqStrings == null || eqStrings.Length <= 4)
            {
                for (int i = 0; i < eqJLlist.Count; i++)
                {
                    if (eqJLlist[i].needLv < 0)
                    {
                        continue;
                    }
                    if (ii == 0)
                    {
                        rssList.Add(eqJLlist[i]);
                        return(rssList);
                    }
                    rssList.Add(eqJLlist[i < eqJLlist.Count - 1 ? i + 1 : eqJLlist.Count - 1]);
                    return(rssList);
                }
            }
            int templv = -1;
            for (int j = 0; j < eqStrings.Length; j++)
            {
                if (!showTypeNum)
                {
                    Equip eq = StorageManagerment.Instance.getEquip(eqStrings[j]);
                    if (templv == -1 || templv > eq.getrefineLevel())
                    {
                        templv = eq.getrefineLevel();
                    }
                }
                else
                {
                    if (templv == -1 || templv > showChatEquips[j].getrefineLevel())
                    {
                        templv = showChatEquips[j].getrefineLevel();
                    }
                }
            }
            for (int i = 0; i < eqJLlist.Count; i++)
            {
                if (ii == 0) //当前等级
                {
                    if (eqJLlist[i].needLv > templv)
                    {
                        rssList.Add(eqJLlist[i == 0 ? 0 : i - 1]);
                        showTypeNum = false;
                        return(rssList);
                    }
                    if (i != eqJLlist.Count - 1 || eqJLlist[i].needLv > templv)
                    {
                        continue;
                    }
                    rssList.Add(eqJLlist[eqJLlist.Count - 1]);
                    return(rssList);
                }
                if (eqJLlist[i].needLv > templv)
                {
                    rssList.Add(eqJLlist[i]);
                    showTypeNum = false;
                    return(rssList);
                }
                if (i != eqJLlist.Count - 1 || eqJLlist[i].needLv > templv)
                {
                    continue;
                }
                rssList.Add(eqJLlist[eqJLlist.Count - 1]);
                showTypeNum = false;
                return(rssList);
            }
        }
        ArrayList bores = card.getStarSoulBores();

        if (bores == null || bores.Count <= 0)
        {
            for (int i = 0; i < starList.Count; i++)
            {
                if (starList[i].needLv >= 0)
                {
                    if (ii == 0)
                    {
                        rssList.Add(starList[i]);
                        return(rssList);
                    }
                    rssList.Add(starList[i < starList.Count - 1 ? i + 1 : starList.Count - 1]);
                    return(rssList);
                }
            }
        }
        int kk = 0;

        if (!showTypeNum)
        {
            for (int i = 0; i < 6; i++)//检查几个没有开
            {
                if (!StarSoulManager.Instance.checkBroeOpenLev(card, i + 1))
                {
                    kk++;
                }
            }
            if (bores.Count + kk < 6)
            {
                if (ii == 0)
                {
                    rssList.Add(starList[0]);
                    return(rssList);
                }
                rssList.Add(starList[1]);
                return(rssList);
            }
        }
        else
        {
            for (int i = 0; i < 6; i++)
            {
                if (EXPSampleManager.Instance.getLevel(EXPSampleManager.SID_USER_EXP, exp, 0) >= StarSoulConfigManager.Instance.getGrooveOpen()[i])
                {
                    kk++;
                }
            }
            if (bores.Count + kk < 6)
            {
                if (ii == 0)
                {
                    rssList.Add(starList[0]);
                    return(rssList);
                }
                rssList.Add(starList[1]);
                return(rssList);
            }
        }
        int temppp = -1;

        for (int t = 0; t < bores.Count; t++)
        {
            if (showTypeNum)
            {
//                List<Card> teamData = new List<Card>();
//                teamData = StarSoulManager.Instance.getTeamCardData(1, card);
//                int lv = teamData[t].getLevel();
                StarSoulBore starSoulBore = bores[t] as StarSoulBore;
                StarSoul     soul         = new StarSoul("0", starSoulBore.getSid(), starSoulBore.getExp(), 0);
                int          lv           = soul.getLevel();
                if (temppp == -1 || temppp > lv)
                {
                    temppp = lv;
                }
            }
            else
            {
                StarSoulBore starSoulBore = bores[t] as StarSoulBore;
                int          lv           = StorageManagerment.Instance.getStarSoul(starSoulBore.getUid()).getLevel();
                if (temppp == -1 || temppp > lv)
                {
                    temppp = lv;
                }
            }
        }
        for (int i = 0; i < starList.Count; i++)
        {
            if (ii == 0) //当前等级
            {
                if (starList[i].needLv > temppp)
                {
                    rssList.Add(starList[i == 0 ? 0 : i - 1]);
                    showTypeNum = false;
                    return(rssList);
                }
                if (i != starList.Count - 1 || starList[i].needLv > temppp)
                {
                    continue;
                }
                rssList.Add(starList[starList.Count - 1]);
                return(rssList);
            }
            if (starList[i].needLv > temppp)
            {
                rssList.Add(starList[i]);
                showTypeNum = false;
                return(rssList);
            }
            if (i != starList.Count - 1 || starList[i].needLv > temppp)
            {
                continue;
            }
            rssList.Add(starList[starList.Count - 1]);
            showTypeNum = false;
            return(rssList);
        }
        return(null);
    }
コード例 #9
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);
     }
 }