Exemple #1
0
    public void RefreshUI(HeroData hd)
    {
        NameLabel.text = "[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(hd.grade) + "]" + hd.node.name + "[-]";
        //NameLabel.color = ChangeNameColor(hd.grade);

        for (int i = 0; i < star.Count; i++)
        {
            star[i].spriteName = i < hd.star ? "xing" : "xing-hui";
        }

        LvLabel.text = hd.lvl + "级";

        ExpBar.value = hd.exps / (float)hd.maxExps;
        ExpBar.transform.Find("Label").GetComponent <UILabel>().text = hd.exps + "/" + hd.maxExps;
        HeroType.spriteName = UISign_in.Instance().GetHeroType(hd.node.attribute);
        hd.RefreshAttr();
        Figting.text = hd.fc.ToString();// hd.fc + "";
        if (shengJiEffect != null)
        {
            if (shengJiEffect.gameObject.activeSelf)
            {
                shengJiEffect.gameObject.SetActive(false);
            }
        }
    }
Exemple #2
0
 /// <summary>
 /// 吃药方法
 /// </summary>
 void EatDrug()
 {
     if (currentCount <= 0)
     {
         PromptPanel.instance.ShowPrompt("药品个数为零");
         CancelInvoke("EatDrug");
         isComplete = false;
         //ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(Globe.selectHero.hero_id, itemNode.props_id, useCount, upGradelvl);
         GoodsDataOperation.GetInstance().UseGoods((int)itemNode.props_id, useCount);
         UI_HeroDetail.instance.UpGradeStar.RefreshDrug(hd);
         return;
     }
     hd = playerData.GetInstance().GetHeroDataByID(Globe.selectHero.hero_id);
     if (hd.lvl >= playerNode.heroLvLimit)
     {
         PromptPanel.instance.ShowPrompt("请提升玩家等级");
         CancelInvoke("EatDrug");
         isComplete = false;
         //ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(Globe.selectHero.hero_id, itemNode.props_id, useCount, upGradelvl);
         GoodsDataOperation.GetInstance().UseGoods((int)itemNode.props_id, useCount);
         UI_HeroDetail.instance.UpGradeStar.RefreshDrug(hd);
         return;
     }
     currentCount -= 1;
     useCount++;
     count.text = currentCount.ToString();
     counts     = hd.exps;
     exp        = itemNode.exp_gain;
     //经验条滚动,每个药品使用的时间
     UI_HeroDetail.instance.UpGrade(0f, userRate / itemNode.exp_gain, itemNode, playerNode);
 }
Exemple #3
0
 public void HeroEMonHandler()
 {
     ed.grade++;
     GoodsDataOperation.GetInstance().UseGoods(needMatDic);
     OnUpdateEquipInfo();
     EquipPanel.instance.ShowEquip(hd);
 }
Exemple #4
0
    void OnSynthesisBtn()
    {
        print("一键合成");

        runesGlod = 0;

        List <ItemData> runesData = GoodsDataOperation.GetInstance().GetItemListByItmeType(ItemType.Rune);

        for (int i = 0; i < runesData.Count; i++)
        {
            if (!runesDic.ContainsKey(runesData[i].Id))
            {
                runesDic.Add(runesData[i].Id, runesData[i].Count);
            }
        }

        //runesDic = playerData.GetInstance().runesDic;

        indexK = 0;

        RunesRecursion();

        //playerData.GetInstance().runesDic = runesDic;

        foreach (long id in upGradeDic.Keys)
        {
            ClientSendDataMgr.GetSingle().GetHeroSend().SendRunesCompounes(id, upGradeDic[id]);
        }

        RefreshRunes();
    }
Exemple #5
0
 /// <summary>
 /// 出售按钮
 /// </summary>
 private void OnSellClick()
 {
     Globe.isOnce = false;
     GoodsDataOperation.GetInstance().SaleGoldProp();
     //UIMask.Instance.ClosePanle(GameLibrary.UI_ShopSell);
     Control.HideGUI(this.GetUIKey());
 }
Exemple #6
0
    protected override void ShowHandler()
    {
        base.ShowHandler();


        if (itemIcon != null)
        {
            itemIcon.uiAtlas = item.UiAtlas;
        }
        if (item.Types == 6)
        {
            point.gameObject.SetActive(true);
        }
        else
        {
            point.gameObject.SetActive(false);
        }
        if (item.IconName != null)
        {
            itemIcon.spriteName = item.IconName;
        }
        if (item.Count != null)
        {
            itemCount.text = item.Count.ToString();
        }
        A_Sprite.spriteName = GoodsDataOperation.GetInstance().GetFrameByGradeType(item.GradeTYPE);
    }
Exemple #7
0
    //合成
    void EquipCompoundOnClick()
    {
        int  needcount = GameLibrary.Instance().ItemStateList[propid].syn_condition.Length / 2;
        long itemid;
        int  itemcount;
        bool isenable = true;

        for (int i = 0; i < needcount; i++)
        {
            itemid    = GameLibrary.Instance().ItemStateList[propid].syn_condition[i, 0];
            itemcount = (int)GameLibrary.Instance().ItemStateList[propid].syn_condition[i, 1];
            if (GoodsDataOperation.GetInstance().GetItemCountById(itemid) < itemcount)
            {
                isenable = false;
                break;
            }
        }
        if (isenable)
        {
            ClientSendDataMgr.GetSingle().GetHeroSend().SendHeroECom(propid, 1);
        }
        else
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "材料不足.");
        }
    }
Exemple #8
0
    protected override void ShowHandler()
    {
        base.ShowHandler();
        nowtime         = Auxiliary.GetNowTime();
        scrollBar.value = 1;
        ClearListData();
        InitChatInfoList();

        //OnChatChannelClick((int)(Globe.selectChatChannel) - 1, true);
        //打开聊天面板只需判断一次,因为在聊天面板内,玩家等级和vip等级是不会变的
        List <ItemData> list = GoodsDataOperation.GetInstance().GetItemListByItmeType(ItemType.Horn);

        if (list.Count > 0)
        {
            horbCount = list[0].Count;
        }
        else
        {
            horbCount = 10;
        }
        RefreshChatShow();
        RefreshHorbCount();
        JudgePlayerIsCanSpeak();
        checkBoxs.DefauleIndex = (int)(Globe.selectChatChannel) - 1;
    }
Exemple #9
0
    /// <summary>
    /// 长按持续吃药水
    /// </summary>
    /// <param name="go"></param>
    /// <param name="state"></param>
    private void OnPressIconClick(GameObject go, bool state)
    {
        Globe.selectHero = heroVo;
        heroData         = playerData.GetInstance().GetHeroDataByID(Globe.selectHero.hero_id);
        if (state)
        {
            //isContinued = true;
            //Invoke("OnMedicine", 1);

            InvokeRepeating("EatDrug", 1, userRate);
        }
        else
        {
            //Debug.LogError(state);
            //isContinued = false;
            //CancelInvoke("OnMedicine");
            CancelInvoke("EatDrug");
            //长按松开的时候 才向服务器发送信息
            if (useCount != 0)
            {
                ItemNodeState itemnodestate = null;
                if (GameLibrary.Instance().ItemStateList.ContainsKey(GoodsDetials.instance.currentSItemData.Id))
                {
                    itemnodestate = GameLibrary.Instance().ItemStateList[GoodsDetials.instance.currentSItemData.Id];
                    //ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(heroData.id, FSDataNodeTable<ItemNode>.GetSingleton().FindDataByType(GoodsDetials.instance.currentSItemData.Id).props_id, useCount, upGradelvl);
                    //ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(heroData.id, itemnodestate.props_id, useCount, upGradelvl);
                    GoodsDataOperation.GetInstance().UseGoods((int)GoodsDetials.instance.currentSItemData.Id, useCount);
                }
            }
            upGradelvl = 0;
            useCount   = 0;
        }
    }
Exemple #10
0
    //英雄品级 1:白,2:绿,3:蓝,4:紫,5:橙:,6:红;
    private void SetLabelHint(int grade)
    {
        switch (grade)
        {
        case 1:
            hintLabel.text = "装备均达到品质[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(UI_HeroDetail.hd.grade + 1) + "]绿色品质[-]以上,英雄方可进阶";
            break;

        case 2:
            hintLabel.text = "装备均达到品质[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(UI_HeroDetail.hd.grade + 1) + "]蓝色品质[-]以上,英雄方可进阶";
            break;

        case 3:
            hintLabel.text = "装备均达到品质[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(UI_HeroDetail.hd.grade + 1) + "]紫色品质[-]以上,英雄方可进阶";
            break;

        case 4:
            hintLabel.text = "装备均达到品质[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(UI_HeroDetail.hd.grade + 1) + "]橙色品质[-]以上,英雄方可进阶";
            break;

        case 5:
            hintLabel.text = "装备均达到品质[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(UI_HeroDetail.hd.grade + 1) + "]红色品质[-]以上,英雄方可进阶";
            break;

        case 6:
            hintLabel.text = "英雄已达到最大品质";
            break;

        default:
            break;
        }
    }
Exemple #11
0
    public void RefreshData()
    {
        HeroUpFrontName.text       = "[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(UI_HeroDetail.hd.grade) + "]" + UI_HeroDetail.hd.node.name + "[-]";
        HeroUpQueenName.text       = "[" + GoodsDataOperation.GetInstance().GetNameColourByHeroGrade(UI_HeroDetail.hd.grade + 1) + "]" + UI_HeroDetail.hd.node.name + "[-]";
        HeroUpFrontIcon.spriteName = UI_HeroDetail.hd.node.icon_name;
        HeroUpQueenIcon.spriteName = UI_HeroDetail.hd.node.icon_name;
        HeroUpFront.spriteName     = UISign_in.GetHeroGradeName(UI_HeroDetail.hd.grade);
        HeroUpQueen.spriteName     = UISign_in.GetHeroGradeName(UI_HeroDetail.hd.grade + 1);

        foreach (var item in FSDataNodeTable <HeroAttrNode> .GetSingleton().DataNodeList.Values)
        {
            if (item.grade == UI_HeroDetail.hd.grade && item.id == UI_HeroDetail.hd.id || item.grade == UI_HeroDetail.hd.grade + 1 && item.id == UI_HeroDetail.hd.id)
            {
                itemRankList.Add(item);
            }
            if (item.grade == UI_HeroDetail.hd.grade && item.id == UI_HeroDetail.hd.id)
            {
                Money.text = item.break_gold.ToString();
            }
            if (item.grade == UI_HeroDetail.hd.grade && item.name == UI_HeroDetail.hd.node.name)
            {
                advancedLevelLabel.text = "进阶下一级英雄需要达到" + item.break_lv.ToString();
            }
        }
        GetHeroArr();
        //HeroPreviewList.InSize(18, 1);
        //HeroPreviewList.Info(itemRankList.ToArray());
        SetLabelHint(UI_HeroDetail.hd.grade);
    }
Exemple #12
0
 public static GoodsDataOperation GetInstance()
 {
     if (instance == null)
     {
         instance = new GoodsDataOperation();
     }
     return(instance);
 }
Exemple #13
0
    /// <summary>
    /// 经验条滚动
    /// </summary>
    void OnSecondFunction()
    {
        exp -= 1;
        counts++;

        //更新经验条信息
        expSlider.value = 1f * counts / heroData.maxExps;
        expLabel.text   = Mathf.CeilToInt((1f * counts / heroData.maxExps) * heroData.maxExps) + "/" + heroData.maxExps;
        levelLabel.text = "Lv." + heroData.lvl;

        if ((1f * counts / heroData.maxExps) >= 1f)
        {
            counts = 0;


            heroData.lvl++;
            upGradelvl++;
            //heroData.maxExps = FSDataNodeTable<HeroUpGradeNode>.GetSingleton().FindDataByType(heroData.lvl).exp;
            heroData.maxExps = VOManager.Instance().GetCSV <HeroUpgradeCSV>("HeroUpgrade").GetVO(heroData.lvl).exp;
            expSlider.value  = 0;
            expLabel.text    = exp + "/" + heroData.maxExps;
            levelLabel.text  = "Lv." + heroData.lvl;

            if (heroData.lvl >= playerData.GetInstance().selfData.level)
            {
                heroData.exps = 0;

                expSlider.value = 0;
                expLabel.text   = heroData.exps + "/" + heroData.maxExps;
                levelLabel.text = "Lv." + heroData.lvl;

                CancelInvoke("EatDrug");
                CancelInvoke("OnSecondFunction");
            }
        }

        if (exp < 1)
        {
            //点击 进度条走完之后再像服务器发送
            if (isOnClick)
            {
                ItemNodeState itemnodestate = null;
                if (GameLibrary.Instance().ItemStateList.ContainsKey(GoodsDetials.instance.currentSItemData.Id))
                {
                    itemnodestate = GameLibrary.Instance().ItemStateList[GoodsDetials.instance.currentSItemData.Id];
                    //ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(heroData.id, FSDataNodeTable<ItemNode>.GetSingleton().FindDataByType(GoodsDetials.instance.currentSItemData.Id).props_id, useCount, upGradelvl);
                    //ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(heroData.id, itemnodestate.props_id, useCount, upGradelvl);
                    GoodsDataOperation.GetInstance().UseGoods((int)GoodsDetials.instance.currentSItemData.Id, useCount);
                }

                isOnClick  = false;
                upGradelvl = 0;
                useCount   = 0;
            }
            heroData.exps = counts;
            CancelInvoke("OnSecondFunction");
        }
    }
Exemple #14
0
 /// <summary>
 /// 刷新购买扫荡卷
 /// </summary>
 public void BuySweepVoucher()
 {
     if (bugSweepVoucher.gameObject.activeSelf)
     {
         bugSweepVoucher.gameObject.SetActive(false);
     }
     SweepVoucher            = GoodsDataOperation.GetInstance().GetItemCountById(110000100);
     LaCleanoutTokenNum.text = "" + SweepVoucher;
 }
Exemple #15
0
    protected override void ShowHandler()
    {
        currentCount = 1;
        ItemNodeState itemnodestate = null;

        if (equipItem == null)
        {
            return;
        }
        for (int i = 0; i < playerData.GetInstance().baginfo.itemlist.Count; i++)
        {
            if (equipItem.Id == playerData.GetInstance().baginfo.itemlist[i].Id)
            {
                maxCount = playerData.GetInstance().baginfo.itemlist[i].Count;
            }
        }
        //if (playerData.GetInstance().baginfo.ItemDic.ContainsKey(equipItem.Id))
        //{
        //    maxCount = playerData.GetInstance().baginfo.ItemDic[equipItem.Id].Count;
        //}

        iconS.spriteName = equipItem.IconName;
        goods.spriteName = ItemData.GetFrameByGradeType(equipItem.GradeTYPE);
        goodsName.text   = GoodsDataOperation.GetInstance().JointNameColour(equipItem.Name, equipItem.GradeTYPE);
        if (equipItem.Types == 6 || equipItem.Types == 3)
        {
            debris.gameObject.SetActive(true);
        }
        else
        {
            debris.gameObject.SetActive(false);
        }
        if (equipItem.Types == 3)
        {
            debris.GetComponent <UISprite>().spriteName = "materialdebris";
            debris.GetComponent <UISprite>().MakePixelPerfect();
        }
        else if (equipItem.Types == 6)
        {
            debris.GetComponent <UISprite>().spriteName = "linghunshi";
            debris.GetComponent <UISprite>().MakePixelPerfect();
        }
        icon.uiAtlas = equipItem.UiAtlas;


        //goodsCount.text = equipItem.conut.ToString();
        goodsCount.text = maxCount + "";
        if (GameLibrary.Instance().ItemStateList.ContainsKey(equipItem.Id))
        {
            itemnodestate      = GameLibrary.Instance().ItemStateList[equipItem.Id];
            unitExpValue.text  = itemnodestate.exp_gain.ToString();
            totalExpValue.text = currentCount * itemnodestate.exp_gain + "";
        }
        expPoolValue.text = playerData.GetInstance().selfData.expPool + "";//经验池的经验值
        //saleCount.text = currentCount + "/" + equipItem.conut;
        saleCount.text = currentCount + "/" + maxCount;
    }
Exemple #16
0
    //是否有材料满足进化(用于是否显示按钮)
    public bool IsHaveMaterial()
    {
        ItemNodeState currentins;
        ItemNodeState nextins;
        int           count = 0;

        for (int i = 0; i < playerData.GetInstance().selectHeroDetail.equipSite.Count; i++)
        {
            currentins = GameLibrary.Instance().ItemStateList[playerData.GetInstance().selectHeroDetail.equipSite[i + 1].id];
            if (currentins.next_grade != 0)
            {
                nextins = GameLibrary.Instance().ItemStateList[currentins.next_grade];
            }
            else
            {
                nextins = null;
            }
            if (nextins != null)
            {
                long matalid = 0;
                long cont    = 0;
                for (long j = 0; j < nextins.syn_condition.Length / 2; j++)
                {
                    matalid = nextins.syn_condition[j, 0];
                    cont    = nextins.syn_condition[j, 1];
                    if (matalid != 0)
                    {
                        if (GoodsDataOperation.GetInstance().GetItemCountById(matalid) < cont)
                        {
                            IsItemMaterialcondition = false;   //进化材料是否满足
                            noconditonMatalId       = matalid; //所缺材料id
                            count++;                           //材料不够
                            break;
                        }
                        //材料满足但是装备品质已经超过了英雄品质
                        int needlv = (1 + playerData.GetInstance().selectHeroDetail.grade) * playerData.GetInstance().selectHeroDetail.grade / 2 + 1;
                        if (currentins.grade + 1 > needlv)
                        {
                            count++;
                            break;
                        }
                    }
                }
            }
        }
        if (count >= 6)
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }
Exemple #17
0
    public void RefreshUI(HeroData hd)
    {
        this.hd            = hd;
        soulItem           = playerData.GetInstance().GetItemDatatByID(hd.node.soul_gem);
        HeroImg.spriteName = hd.node.icon_name;
        icon.spriteName    = GoodsDataOperation.GetInstance().GetSmallHeroGrameByHeroGrade(hd.grade);
        if (null == soulItem)
        {
            currentSoul = 0;
        }
        else
        {
            currentSoul = soulItem.Count;
        }
        for (int i = 0; i < StarList.Length; i++)
        {
            StarList[i].spriteName = i < hd.star ? "xing" : "xing-hui";
        }
        if (hd.star < 5)
        {
            int star = hd.star;
            RisingStarBtn.gameObject.SetActive(true);
            Gold.gameObject.SetActive(true);
            starUpHero = FSDataNodeTable <StarUpGradeNode> .GetSingleton().FindDataByType(++star);

            //更换英雄魂石图标 Gold 魂石条

            Gold.text = "" + starUpHero.evolve_cost;

            //魂石条赋值
            jingyancao.value = currentSoul / (float)starUpHero.evolve_stone_num;
            jingyancao.transform.Find("Label").GetComponent <UILabel>().text = currentSoul + "/" + starUpHero.evolve_stone_num;
        }
        else
        {
            Gold.text        = "";
            jingyancao.value = 1 / 1;
            //jingyancao.transform.Find("Label").GetComponent<UILabel>().text = currentSoul + " 英雄星级已达到满级";
            jingyancao.transform.Find("Label").GetComponent <UILabel>().text = " 英雄星级已达到满级";
            RisingStarBtn.gameObject.SetActive(false);
            Gold.gameObject.SetActive(false);
        }
        if (shengXingEffect != null)
        {
            if (shengXingEffect.gameObject.activeSelf)
            {
                shengXingEffect.gameObject.SetActive(false);
            }
        }
        for (int i = 0; i < xingxingEffect.Length; i++)
        {
            xingxingEffect[i].gameObject.SetActive(false);
        }
    }
Exemple #18
0
    public void Setgoods(ItemNodeState ItemNode, long ID)
    {
        this.goodsname = GoodsDataOperation.GetInstance().JointNameColour(ItemNode.name, GetGradeType(ItemNode.grade));
        this.decs      = GoodsDataOperation.GetInstance().GetConvertGoodsDes(ItemNode, ID);
        this.goodsimg  = ItemNode.icon_name;
        this.kuangs    = GetspriteName(ItemNode.grade);
        this.ID        = ID;

        if (ItemNode.name != null && ItemNode.describe != null && ItemNode.icon_name != null && ID != null)
        {
            Show();
        }
    }
Exemple #19
0
    /// <summary>
    /// 升星成功
    /// </summary>
    public void RisingStarSuccess()
    {
        StarUpGradeNode starUpHero = FSDataNodeTable <StarUpGradeNode> .GetSingleton().FindDataByType(hd.star);

        //减去金币,使用的魂石
        playerData.GetInstance().MoneyHadler(MoneyType.Gold, -starUpHero.evolve_cost);
        GoodsDataOperation.GetInstance().UseGoods(hd.node.soul_gem, starUpHero.call_stone_num);

        hd.star++;

        UpGradeStar.RefreshSoulStone(hd);
        NameArea.RefreshUI(hd);
    }
Exemple #20
0
 private void OnSureBtnClick()
 {
     GameLibrary.saleItemList.Clear();
     object[] obj = new object[] { equipItem.Id, equipItem.Uuid, currentCount };
     GameLibrary.saleItemList.Add(obj);
     Globe.isSaleSingleGood = true;
     GoodsDataOperation.GetInstance().equipItem    = equipItem;
     GoodsDataOperation.GetInstance().currentCount = currentCount;
     //ClientSendDataMgr.GetSingle().GetItemSend().SendSellItem(equipItem.itmeid, equipItem.itemuuid, currentCount);
     ClientSendDataMgr.GetSingle().GetItemSend().SendSellItem(GameLibrary.saleItemList);
     Control.HideGUI(this.GetUIKey());
     //Hide();
 }
Exemple #21
0
    //判断进化所需材料是否满足
    bool IsItemConditon()
    {
        ItemNodeState ins = GameLibrary.Instance().ItemStateList[ed.id];

        ItemNodeState nexins = null;

        if (ins.next_grade != 0)
        {
            nexins = GameLibrary.Instance().ItemStateList [ins.next_grade];
        }
        IsItemMaterialcondition = true; //进化材料是否满足
        noconditonMatalId       = 0;    //所缺材料id
        Ismoney = true;                 //金是否满足

        long matalid;
        long cont = 0;

        if (nexins != null)
        {
            //英雄品质不足
            int needlv = (1 + playerData.GetInstance().selectHeroDetail.grade) * playerData.GetInstance().selectHeroDetail.grade / 2 + 1;
            if (ins.grade + 1 > needlv)
            {
                return(false);
            }
            if (nexins.syn_cost > playerData.GetInstance().baginfo.gold)
            {
                Ismoney = false;
                return(false);
            }
            for (long i = 0; i < nexins.syn_condition.Length / 2; i++)
            {
                matalid = nexins.syn_condition [i, 0];
                cont    = nexins.syn_condition [i, 1];
                if (matalid != 0)
                {
                    if (GoodsDataOperation.GetInstance().GetItemCountById(matalid) < cont)
                    {
                        IsItemMaterialcondition = false;                    //进化材料是否满足
                        noconditonMatalId       = matalid;                  //所缺材料id
                        return(false);
                    }
                }
            }
        }
        else
        {
            return(false);
        }
        return(true);
    }
Exemple #22
0
    protected override void ShowHandler()
    {
        if (equipItem == null)
        {
            return;
        }
        for (int i = 0; i < playerData.GetInstance().baginfo.itemlist.Count; i++)
        {
            if (equipItem.Id == playerData.GetInstance().baginfo.itemlist[i].Id)
            {
                maxCount = playerData.GetInstance().baginfo.itemlist[i].Count;
            }
        }
        //if (playerData.GetInstance().baginfo.ItemDic.ContainsKey(equipItem.Id))
        //{
        //    maxCount = playerData.GetInstance().baginfo.ItemDic[equipItem.Id].Count;
        //}

        currentCount     = 1;
        iconS.spriteName = equipItem.IconName;
        goods.spriteName = ItemData.GetFrameByGradeType(equipItem.GradeTYPE);
        goodsName.text   = GoodsDataOperation.GetInstance().JointNameColour(equipItem.Name, equipItem.GradeTYPE);;
        if (equipItem.Types == 6 || equipItem.Types == 3)
        {
            debris.gameObject.SetActive(true);
        }
        else
        {
            debris.gameObject.SetActive(false);
        }
        if (equipItem.Types == 3)
        {
            debris.GetComponent <UISprite>().spriteName = "materialdebris";
            debris.GetComponent <UISprite>().MakePixelPerfect();
        }
        else if (equipItem.Types == 6)
        {
            debris.GetComponent <UISprite>().spriteName = "linghunshi";
            debris.GetComponent <UISprite>().MakePixelPerfect();
        }
        icon.uiAtlas = equipItem.UiAtlas;


        //goodsCount.text = equipItem.conut.ToString();
        goodsCount.text = maxCount + "";
        unitPrice.text  = equipItem.Sprice.ToString();
        //saleCount.text = currentCount + "/" + equipItem.conut;
        saleCount.text  = currentCount + "/" + maxCount;
        totalPrice.text = currentCount * equipItem.Sprice + "";
    }
Exemple #23
0
    public void HeroEComHandler()
    {
        GoodsDataOperation.GetInstance().UseGoods(needMatDic);
        GoodsDataOperation.GetInstance().AddGoods((int)itemNeed.props_id, 1);

        eMatMultList.Info(obj);

        if (isNood)
        {
            OnIconClick(gameObject);
        }

        OnUpdateEquipInfo();
        EquipPanel.instance.ShowEquip(hd);
    }
Exemple #24
0
 /// <summary>
 /// 刷新喇叭数量
 /// </summary>
 public void RefreshHorbCount()
 {
     horbCount = GoodsDataOperation.GetInstance().GetItemCountById(113000100);
     if (Globe.selectChatChannel == ChatType.WorldChat)
     {
         horbCoutLabel.gameObject.SetActive(true);
         horbSprite.gameObject.SetActive(true);
         horbCoutLabel.text = "x" + horbCount;
     }
     else
     {
         horbSprite.gameObject.SetActive(false);
         horbCoutLabel.gameObject.SetActive(false);
     }
 }
Exemple #25
0
    public void UpdateInfo()
    {
        HeroData hd = playerData.GetInstance().GetHeroDataByID(Recordid);

        hd.lvl     = Recordlvl;
        hd.exps    = RecordCurE;
        hd.maxExps = RecordMaxE;

        int count = playerData.GetInstance().GetItemCountById(DrugID);

        GoodsDataOperation.GetInstance().AddGoods(DrugID, DrugCount - count);

        UI_HeroDetail.instance.NameArea.RefreshUI(hd);
        RefreshDrug(hd);
    }
Exemple #26
0
 protected override void ShowHandler()
 {
     if (equipData != null)
     {
         if (GameLibrary.Instance().ItemStateList.ContainsKey(equipData.id))
         {
             itemData         = GameLibrary.Instance().ItemStateList[equipData.id];
             icon.spriteName  = itemData.icon_name;
             level.text       = equipData.level + "级";
             grade.spriteName = GoodsDataOperation.GetInstance().GetFrameByGrade(equipData.grade);
             equipName.text   = GoodsDataOperation.GetInstance().JointEquipNameColour(itemData.name, (GradeType)equipData.grade);
             GeEquipStrengthArr();
         }
     }
 }
Exemple #27
0
 public void StopEatDrug()
 {
     if (isStop)
     {
         return;
     }
     UI_HeroDetail.instance.UpGradeStar.SetMaskPanel(false);
     if (useCount != 0)
     {
         //ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(Globe.selectHero.hero_id, itemNode.props_id, useCount, upGradelvl);
         GoodsDataOperation.GetInstance().UseGoods((int)itemNode.props_id, useCount);
         UI_HeroDetail.instance.UpGradeStar.RefreshDrug(hd);
         upGradelvl = 0;
         useCount   = 0;
     }
 }
Exemple #28
0
    /// <summary>
    /// 升级按钮
    /// </summary>
    private void OnUpgradeBtnClick()
    {
        //hd_ins.UpGradeStar.RecordUseDrug(hd, item);
        //upgradeBtn.GetComponent<BoxCollider>().enabled = false;
        //aKeyUpgradeBtn.GetComponent<BoxCollider>().enabled = false;
        //mask.gameObject.SetActive(true);
        currentDrug            = playerData.GetInstance().GetItemCountById(itemNode.props_id);
        playerNode.heroLvLimit = 10;
        if (hd.lvl >= playerNode.heroLvLimit)
        {
            PromptPanel.instance.ShowPrompt("请提升玩家等级等级");
            return;
        }
        if (currentDrug <= 0)
        {
            PromptPanel.instance.ShowPrompt("药品个数为0");
            return;
        }
        currentDrug--;
        GoodsDataOperation.GetInstance().UseGoods((int)itemNode.props_id, 1);
        //if (currentDrug <= 0)
        //{
        //    playerData.GetInstance().drugDic.Remove(item.props_id);
        //    playerData.GetInstance().drugKeys.Remove(item.props_id);
        //}
        UI_HeroDetail.instance.UpGradeStar.RefreshDrug(hd);
        hd_ins.countD += 1;
        useCount++; //计算使用个数
        //开启向服务器发送条件,记录使用情况
        isUse = true;
        //hd_ins.isSendDrug = true;
        hd_ins.heroIDD = hero.hero_id;
        hd_ins.itemIDD = itemNode.props_id;
        hd_ins.countD++;
        //if (currentDrug <= 0) bottlCount.text = "";
        //else bottlCount.text = currentDrug.ToString();
        //currentEXP = hd.exps;
        UpGradeLevels();
        ////记录使用的药品和个数
        //if (hd_ins.conDrugDic.ContainsKey(item.props_id))
        //{
        //    hd_ins.conDrugDic.Remove(item.props_id);
        //}

        //hd_ins.conDrugDic.Add(item.props_id, useCount);
        UI_HeroDetail.instance.NameArea.RefreshUI(hd);
    }
Exemple #29
0
    public void RefreshDrug(HeroData hd)
    {
        this.hd = hd;

        List <ItemData> expItem = GoodsDataOperation.GetInstance().GetItemListByItmeType(ItemType.ExpProp);

        object[] drug = new object[12];

        for (int i = 0; i < expItem.Count; i++)
        {
            drug[i] = expItem[i];
        }
        //Debug.Log(GoodsDataOperation.GetInstance().GetItemListByItmeType(ItemType.ExpProp).Count);
        //经验药水集合
        //EXPList.InSize(GoodsDataOperation.GetInstance().GetItemListByItmeType(ItemType.ExpProp).Count, 3);
        //EXPList.Info(drug);
    }
Exemple #30
0
    public void InitData(ItemNodeState item)
    {
        selectMaterial = item;
        materialEff    = transform.Find("UI_HCCG_01");
        //materialEff.gameObject.SetActive(false);
        if (selectMaterial != null)
        {
            equipIcon.spriteName = selectMaterial.icon_name;
            equipFram.spriteName = UISign_in.GetspriteName(selectMaterial.grade);
            materialCount.text   = GoodsDataOperation.GetInstance().GetItemCountById(selectMaterial.props_id).ToString();
            int count = selectMaterial.syn_condition.Length / 2;
            if (count > 0)//有合成材料
            {
                for (int i = 0; i < 4; i++)
                {
                    if (i == count - 1)
                    {
                        MaterialFram[i].SetActive(true);
                    }
                    else
                    {
                        MaterialFram[i].SetActive(false);
                    }
                }
                ItemNodeState ins;

                for (int m = 0; m < count; m++)
                {
                    ins = GameLibrary.Instance().ItemStateList[selectMaterial.syn_condition[m, 0]];
                    MaterialArr[GetIndex(m, count)].InitData(ins, 0);
                }
            }
            useMomey.text          = selectMaterial.syn_cost.ToString();
            compoundButton.onClick = OncompoundButton;
            if (!isCompoundcondition(1))
            {
                compoundButton.SetState(GUISingleButton.State.Disabled);
            }
            else
            {
                compoundButton.SetState(GUISingleButton.State.Normal);
            }
        }
        //获取索引值
    }