/// <summary>
    /// 更新页面上UI
    /// </summary>
    public void updateUI()
    {
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + selectProp.getIconId(), icon);
        name.text = QualityManagerment.getQualityColor(selectProp.getQualityId()) + selectProp.getName();;
        string[] desc = selectProp.getDescribe().Split('\n');
        dec.text  = desc[0];
        dec2.text = desc[1];
        openNum   = selectProp.getNum() <= 10?selectProp.getNum():10;

        if (openNum == 0)
        {
            rightButton.disableButton(true);
            leftButton.disableButton(true);
        }
        else
        {
            rightButton.disableButton(false);
            leftButton.disableButton(false);
        }
        content.reload(selectProp.getPrizeSampleLcok(), this);
        PrizeSample[] needProp = selectProp.getNeedPropLcok();
        if (needProp != null && needProp.Length >= 1)
        {
            GoodsSample p           = GoodsSampleManager.Instance.getGoodsSampleBySid(needProp[0].pSid);
            Prop        prop        = PropManagerment.Instance.createProp(p.goodsSID);
            Prop        storageProp = StorageManagerment.Instance.getProp(prop.sid);
            if (storageProp != null)
            {
                prop.setNum(storageProp.getNum());
            }
            else
            {
                prop.setNum(0);
            }

            needP.init(prop);
            needP.setCountActive(true);
            lockSid      = p.goodsSID;
            needNum      = needProp[0].getPrizeNumByInt();
            luckGoodsSid = needProp[0].pSid;
            needDec.text = QualityManagerment.getQualityColor(prop.getQualityId()) + prop.getName() + "X" + needNum.ToString();
        }
        int num = 10;

        if (selectProp.getNum() < num)
        {
            num = selectProp.getNum();
        }
        rightButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s03l2", num.ToString());
    }
Beispiel #2
0
    /// <summary>
    /// 描述数据写入label
    /// </summary>
    private void writeInLabel()
    {
        otherCondition.gameObject.SetActive(false);
        ExchangeManagerment exchangeManagerment = ExchangeManagerment.Instance;

        //先拿普通兑换前置的描述
        string[] strrr = exchangeManagerment.getAllPremises(temp, 0);
        string[] str   = new string[strrr.Length];
        for (int ss = 0; ss < strrr.Length; ss++)
        {
            if (strrr[ss].StartsWith(Colors.GREEN))
            {
                str[ss] = Colors.GRENN + strrr[ss].Substring(8);
            }
            else if (strrr[ss].StartsWith(Colors.RED))
            {
                str[ss] = Colors.REDD + strrr[ss].Substring(8);
            }
            else
            {
                str[ss] = strrr[ss];
            }
        }
        int k = 0;

        for (int i = 0; i < str.Length; i++)
        {
            conditions[k].text = str[i];
            if (conditions[k].text.EndsWith(LanguageConfigManager.Instance.getLanguage("s0099")))
            {
                conditions[k].text = Colors.REDD + conditions[k].text;
            }
            k++;
        }
        //在拿普通兑换的条件描述
        string[] str1 = exchangeManagerment.getConditionsDesc(temp, 0);
        for (int i = 0; i < str1.Length; i++)
        {
            if (str1[i] != "")
            {
                if (str1[i].StartsWith("[u"))
                {
                    //str1[i]="[u]"+str1[i].Split('^')[0];
                    goodsView.init(temp.conditions[0][i].costType, temp.conditions[0][i].costSid, 1);
                    BoxCollider boxCollider = goodsView.GetComponent <BoxCollider>();
                    boxCollider.center = new Vector3(conditions[k].transform.localPosition.x - 25f, conditions[k].transform.localPosition.y + 51f, boxCollider.center.z);
                    goodsView.setCountActive(false);
                    goodsView.icon.gameObject.SetActive(false);
                }
                conditions[k].text = str1[i];
                k++;
            }
        }
        //拿VIP前置条件
        if (temp.premises.Length > 1)
        {
            string[] str22 = exchangeManagerment.getAllPremises(temp, 1);
            string[] str2  = new string[str22.Length];
            for (int ss = 0; ss < str22.Length; ss++)
            {
                if (str22[ss].StartsWith(Colors.GREEN))
                {
                    str2[ss] = Colors.GRENN + str22[ss].Substring(8);
                }
                else if (strrr[ss].StartsWith(Colors.RED))
                {
                    str2[ss] = Colors.REDD + str22[ss].Substring(8);
                }
                else
                {
                    str2[ss] = str22[ss];
                }
            }
            for (int i = 0; i < str2.Length; i++)
            {
                conditions[k].text = str2[i];
                if (!otherCondition.gameObject.activeSelf)
                {
                    otherCondition.gameObject.SetActive(false);
                    otherCondition.transform.localPosition = conditions[k].transform.localPosition + new Vector3(-11f, 0f, 0f);
                }
                if (conditions[k].text.EndsWith(LanguageConfigManager.Instance.getLanguage("s0099")))
                {
                    conditions[k].text = Colors.REDD + conditions[k].text.Substring(0, conditions[k].text.Length - 5);
                }
                k++;
            }
        }
        if (temp.conditions.Length > 1)
        {
            string[] str3 = exchangeManagerment.getConditionsDesc(temp, 1);
            for (int i = 0; i < str3.Length; i++)
            {
                if (str3[i] != "")
                {
                    if (str3[i].StartsWith("[u]"))
                    {
                        //str3[i]="[u]"+str3[i].Split('^')[1];
                        goodsView.init(temp.conditions[1][i].costType, temp.conditions[1][i].costSid, 1);
                        BoxCollider boxCollider = goodsView.GetComponent <BoxCollider>();
                        boxCollider.center = new Vector3(conditions[k].transform.localPosition.x - 25f, conditions[k].transform.localPosition.y + 51f, boxCollider.center.z);
                        goodsView.setCountActive(false);
                        goodsView.icon.gameObject.SetActive(false);
                    }
                    conditions[k].text = str1[i];
                    k++;
                }
            }
        }
    }