Beispiel #1
0
 private bool checkSotreFull()
 {
     if (item.GetType() == typeof(Goods) || item.GetType() == typeof(NoticeActiveGoods))
     {
         Goods       good   = item as Goods;
         GoodsSample sample = GoodsSampleManager.Instance.getGoodsSampleBySid(good.sid);
         if (sample.goodsType == GoodsType.CARD)
         {
             str = LanguageConfigManager.Instance.getLanguage("s0192", LanguageConfigManager.Instance.getLanguage("cardName"));
             return(StorageManagerment.Instance.isRoleStorageFull(StringKit.toInt(numberText.text)));
         }
         else if (sample.goodsType == GoodsType.EQUIP)
         {
             str = LanguageConfigManager.Instance.getLanguage("s0192", LanguageConfigManager.Instance.getLanguage("s0195"));
             return(StorageManagerment.Instance.isEquipStorageFull(StringKit.toInt(numberText.text)));
         }
         else if (sample.goodsType == GoodsType.TOOL)
         {
             str = LanguageConfigManager.Instance.getLanguage("s0192", LanguageConfigManager.Instance.getLanguage("s0196"));
             return(StorageManagerment.Instance.isPropStorageFull(good.getGoodsSid()));
         }
         else if (sample.goodsType == GoodsType.STARSOUL)
         {
             str = LanguageConfigManager.Instance.getLanguage("s0192", LanguageConfigManager.Instance.getLanguage("s0467"));
             return(StorageManagerment.Instance.isStarSoulStorageFull(StringKit.toInt(numberText.text)));
         }
     }
     return(false);
 }
Beispiel #2
0
 public GoodsSample getSample()
 {
     if (sample == null)
     {
         sample = GoodsSampleManager.Instance.getGoodsSampleBySid(sid);
     }
     return(sample);
 }
Beispiel #3
0
    //解析模板数据
    public override void parseSample(int sid)
    {
        GoodsSample sample  = new GoodsSample();
        string      dataStr = getSampleDataBySid(sid);

        sample.parse(sid, dataStr);
        samples.Add(sid, sample);
    }
Beispiel #4
0
    private bool canBuy()
    {
        switch (costType)
        {
        case PrizeType.PRIZE_RMB:
            if (UserManager.Instance.self.getRMB() >= StringKit.toInt(totalMoney.text))
            {
                return(true);
            }
            break;

        case PrizeType.PRIZE_MONEY:
            if (UserManager.Instance.self.getMoney() >= StringKit.toInt(totalMoney.text))
            {
                return(true);
            }
            break;

        case PrizeType.PRIZE_CONTRIBUTION:
            if (GuildManagerment.Instance.getGuild().contributioning >= StringKit.toInt(totalMoney.text))
            {
                return(true);
            }
            break;

        case PrizeType.PRIZE_STARSOUL_DEBRIS:
            if (StarSoulManager.Instance.getDebrisNumber() >= StringKit.toInt(totalMoney.text))
            {
                return(true);
            }
            break;

        case  PrizeType.PRIZE_MERIT:
            return(UserManager.Instance.self.merit >= StringKit.toInt(totalMoney.text));

        case PrizeType.PRIZE_LEDDER_SCORE:
            return(LadderHegeMoneyManager.Instance.myPort >= StringKit.toInt(totalMoney.text));

            break;

        case PrizeType.PRIZE_PROP:
            Goods       goods = item as Goods;
            GoodsSample gs    = GoodsSampleManager.Instance.getGoodsSampleBySid(goods.sid);
            Prop        p     = StorageManagerment.Instance.getProp(gs.costToolSid);
            if (p == null)
            {
                return(false);
            }
            int propNum = p.getNum();
            return(propNum >= StringKit.toInt(totalMoney.text));

            break;

        default:
            return(false);
        }
        return(false);
    }
    /// <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 #6
0
    public void parseMissonPrizeByGoodsID(string str)
    {
        string[] str1 = str.Split('/');
        this.prizeType = StringKit.toInt(str1[0]);
        this.price     = StringKit.toInt(str1[2]);

        string[] strArr = str1[1].Split(',');
        int      goodID = StringKit.toInt(strArr[1]);

        this.goodsID = goodID;
        GoodsSample goodsample = GoodsSampleManager.Instance.getGoodsSampleBySid(goodID);
        string      strCompose = strArr[0] + "," + goodsample.goodsSID + "," + strArr[2];

        prizes = new PrizeSample[strArr.Length];
        for (int i = 0; i < strArr.Length; i++)
        {
            prizes[i] = new PrizeSample(strCompose, ',');
        }
    }
 private bool checkSotreFull()
 {
     if (item.GetType() == typeof(Goods))
     {
         Goods       good   = item as Goods;
         GoodsSample sample = GoodsSampleManager.Instance.getGoodsSampleBySid(good.sid);
         if (sample.goodsType == GoodsType.TOOL)
         {
             str = LanguageConfigManager.Instance.getLanguage("s0192", LanguageConfigManager.Instance.getLanguage("s0196"));
             //若果临时仓库有东西时,不能打开宝箱,并飘字提示玩家
             if (StorageManagerment.Instance.getAllTemp().Count > 0)
             {
                 UiManager.Instance.openDialogWindow <MessageLineWindow> ((win) => {
                     win.Initialize(LanguageConfigManager.Instance.getLanguage("storeFull_temp_tip"));
                 });
                 return(true);
             }
             return(StorageManagerment.Instance.isPropStorageFull(good.getGoodsSid()));
         }
     }
     return(false);
 }
Beispiel #8
0
 public Goods(int sid)
 {
     this.sid = sid;
     sample   = GoodsSampleManager.Instance.getGoodsSampleBySid(sid);
 }
Beispiel #9
0
    void updateCoinIcon()
    {
        //-1无消耗
        if (costType < 0)          //|| costType == PrizeType.PRIZE_PVE) {
        {
            costIcon.gameObject.SetActive(false);
            totalMoney.gameObject.SetActive(false);
            costStr = "";
            return;
        }
        costIcon.gameObject.SetActive(true);
        switch (costType)
        {
        case PrizeType.PRIZE_RMB:
            costStr             = LanguageConfigManager.Instance.getLanguage("s0048");
            costIcon.spriteName = constResourcesPath.RMBIMAGE;
            break;

        case PrizeType.PRIZE_MONEY:
            costStr             = LanguageConfigManager.Instance.getLanguage("s0049");
            costIcon.spriteName = constResourcesPath.MONEYIMAGE;
            break;

        case PrizeType.PRIZE_CONTRIBUTION:
            costStr = LanguageConfigManager.Instance.getLanguage("Guild_57");
            costIcon.gameObject.SetActive(false);
            break;

        case PrizeType.PRIZE_MERIT:
            costStr             = LanguageConfigManager.Instance.getLanguage("Arena06");
            costIcon.spriteName = constResourcesPath.MERITIMAGE;
            break;

        case PrizeType.PRIZE_PROP:
            costIcon.gameObject.SetActive(false);
            totalMoney.gameObject.SetActive(false);
            if (item.GetType() == typeof(Prop))  //使用行动剂走这里
            {
                Prop prop = item as Prop;
                if (prop.getType() == PropType.PROP_TYPE_PVE)
                {
                    costStr = "";
                    break;
                }
            }
            Goods       goods = item as Goods;
            GoodsSample gs    = GoodsSampleManager.Instance.getGoodsSampleBySid(goods.sid);
            Prop        p     = PropManagerment.Instance.createProp(gs.costToolSid);
            costStr = "" + p.getName();
            break;

        case PrizeType.PRIZE_STARSOUL_DEBRIS:
            costStr             = LanguageConfigManager.Instance.getLanguage("s0466");
            costIcon.spriteName = constResourcesPath.STARSOUL_DEBRIS;
            break;

        case PrizeType.PRIZE_LEDDER_SCORE:
            costStr             = LanguageConfigManager.Instance.getLanguage("laddermoney");
            costIcon.spriteName = constResourcesPath.LADDER_MONEY;
            break;
        }
    }