Esempio n. 1
0
    public override void Info(object obj)
    {
        itemNode = (ItemNodeState)obj;

        if (obj == null)
        {
            //icon.spriteName = item.icon;
        }
        else
        {
            icon.spriteName = itemNode.icon_name;

            //获取背包中所需材料的个数
            item        = playerData.GetInstance().GetItemDatatByID(itemNode.props_id);
            count.color = Color.red;
            //背包中是否有该材料
            if (null == item)
            {
                count.text = 0 + "/" + EquipInfoPanel.instance.matCountM;
            }
            else
            {
                //计算可合成数量
                count.text = item.Count + "/" + EquipInfoPanel.instance.matCountM;

                if (item.Count >= EquipInfoPanel.instance.matCountM)
                {
                    count.color = Color.white;
                    EquipInfoPanel.instance.isNood = true;
                }
            }
        }
    }
Esempio n. 2
0
    protected override void ShowHandler()
    {
        if (showList.Count > 0)
        {
            isShow = true;
            int heroId = int.Parse(201 + StringUtil.SubString(showList[0].ToString(), 6, 3));
            if (FSDataNodeTable <HeroNode> .GetSingleton().DataNodeList.ContainsKey(heroId))
            {
                int startId = FSDataNodeTable <HeroNode> .GetSingleton().DataNodeList[heroId].init_star;

                count = FSDataNodeTable <StarUpGradeNode> .GetSingleton().DataNodeList[startId].convert_stone_num;
            }
            string a  = StringUtil.SubString(showList[0].ToString(), 6, 3);
            int    id = int.Parse(106 + StringUtil.SubString(showList[0].ToString(), 6, 3));
            vo         = GameLibrary.Instance().ItemStateList[id];
            label.text = "您已经拥有此英雄,故赠送您" + count + "个" + vo.name;
            //  Debug.Log(label.text + "      ");
            sprite.spriteName = vo.icon_name;
            // StartCoroutine(DelayTime());
            //GoodsDataOperation.GetInstance().AddGoods(id,count);
        }
        else
        {
            Hide();
            Control.HideGUI(this.GetUIKey());
        }
    }
Esempio n. 3
0
 public void UpGrade(float start, float interval, ItemNodeState itemNode, PlayerLevelUpNode PlayerNode)
 {
     countss    = currentEXP;
     exp        = itemNode.exp_gain;
     expDiffe   = Convert.ToInt32(itemNode.exp_gain / 25);
     playerNode = PlayerNode;
     InvokeRepeating("OnSecondFunction", start, interval);
 }
Esempio n. 4
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");
        }
    }
Esempio n. 5
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;
    }
Esempio n. 6
0
 public void RecordUseDrug(HeroData hd, ItemNodeState item)
 {
     Recordid   = hd.id;
     Recordlvl  = hd.lvl;
     RecordCurE = hd.exps;
     RecordMaxE = hd.maxExps;
     DrugID     = item.props_id;
     DrugCount  = playerData.GetInstance().GetItemCountById(item.props_id);
 }
Esempio n. 7
0
    private ItemData SetItemDate(long id, int count)
    {
        ItemData itemdata = new ItemData();

        itemdata.Id = id;
        ItemNodeState itemnodestate = null;

        if (GameLibrary.Instance().ItemStateList.ContainsKey(itemdata.Id))
        {
            itemnodestate     = GameLibrary.Instance().ItemStateList[itemdata.Id];
            itemdata.Count    = count;
            itemdata.Name     = itemnodestate.name;
            itemdata.Types    = itemnodestate.types;
            itemdata.Describe = itemnodestate.describe;

            itemdata.Sprice   = itemnodestate.sprice;
            itemdata.Piles    = itemnodestate.piles;
            itemdata.IconName = itemnodestate.icon_name;
            switch (itemnodestate.grade)//(VOManager.Instance().GetCSV<ItemCSV>("Item").GetVO(itemdata.Id).grade)
            {
            case 1:
                itemdata.GradeTYPE = GradeType.Gray;
                break;

            case 2:
                itemdata.GradeTYPE = GradeType.Green;
                break;

            case 4:
                itemdata.GradeTYPE = GradeType.Blue;
                break;

            case 7:
                itemdata.GradeTYPE = GradeType.Purple;
                break;

            case 11:
                itemdata.GradeTYPE = GradeType.Orange;
                break;

            case 16:
                itemdata.GradeTYPE = GradeType.Red;
                break;
            }
            if (itemdata.Types == 6)
            {
                itemdata.UiAtlas = ResourceManager.Instance().GetUIAtlas("UIHeroHead");
            }
            else
            {
                itemdata.UiAtlas = ResourceManager.Instance().GetUIAtlas("Prop");
            }
        }
        return(itemdata);
    }
Esempio n. 8
0
 void AddToStateDict(ItemNodeState itemstate)
 {
     if (!GameLibrary.Instance().ItemStateList.ContainsKey(itemstate.props_id))
     {
         GameLibrary.Instance().ItemStateList.Add(itemstate.props_id, itemstate);
     }
     else
     {
         //Debug.Log(itemstate.props_id);
     }
 }
Esempio n. 9
0
    /// <summary>
    /// 材料合成
    /// </summary>
    void MatComposite(ItemNodeState item)
    {
        itemmatl.Clear();
        needMatDic.Clear();

        itemNeed = item;

        List <long> itemList = new List <long>();

        //需要材料
        for (int i = 0; i < (itemNeed.syn_condition.Length / 2); i++)
        {
            for (int j = 0; j < 2; j++)
            {
                matsb.Append(itemNeed.syn_condition[i, j] + ",");
            }
        }

        string needMat = matsb.ToString();

        string[] needMats = needMat.Split(',');
        matsb.Length = 0;

        for (int i = 0; i < needMats.Length - 1; i += 2)
        {
            //当字典中不存在时加入字典
            if (!needMatDic.ContainsKey(long.Parse(needMats[i])))
            {
                needMatDic.Add(long.Parse(needMats[i]), int.Parse(needMats[i + 1]));
            }

            if (!itemList.Contains(long.Parse(needMats[i])))
            {
                itemList.Add(long.Parse(needMats[i]));
            }
        }

        object[] objMat = new object[itemList.Count];

        ItemNodeState itemNodeS;

        for (int i = 0; i < itemList.Count; i++)
        {
            GameLibrary.Instance().ItemStateList.TryGetValue(itemList[i], out itemNodeS);
            objMat[i] = itemNodeS;
        }

        matMultList.InSize(needMats.Length / 2, 5);
        matMultList.Info(objMat);

        evolutionBtn.text = "合成";
    }
Esempio n. 10
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();
        }
    }
Esempio n. 11
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);
    }
Esempio n. 12
0
    public void SetItemInfo(ItemData itemdata)
    {
        ItemNodeState vo = GameLibrary.Instance().ItemStateList[itemdata.Id];

        itemdata.Describe = vo.describe;
        itemdata.IconName = vo.icon_name;
        switch (vo.grade)
        {
        case 1:
            itemdata.GradeTYPE = GradeType.Gray;
            break;

        case 2:
            itemdata.GradeTYPE = GradeType.Green;
            break;

        case 4:
            itemdata.GradeTYPE = GradeType.Blue;
            break;

        case 7:
            itemdata.GradeTYPE = GradeType.Purple;
            break;

        case 11:
            itemdata.GradeTYPE = GradeType.Orange;
            break;

        case 16:
            itemdata.GradeTYPE = GradeType.Red;
            break;
        }

        itemicon.spriteName = itemdata.IconName;
        itemname.text       = itemdata.Name;
        type.text           = itemdata.Types + "";
        shuoming.text       = itemdata.Describe;
        string qualitycolor = "123";

        GameLibrary.QualityColor.TryGetValue(itemdata.GradeTYPE, out qualitycolor);
        if (!string.IsNullOrEmpty(qualitycolor))
        {
            qualityframe.spriteName = qualitycolor;
        }
        else
        {
            Debug.LogError("This Item Quality Is Err");
            qualityframe.spriteName = GameLibrary.QualityColor[GradeType.Gray];
        }
    }
Esempio n. 13
0
    /// <summary>
    /// 信息赋值
    /// </summary>
    /// <param name="obj"></param>
    public override void Info(object obj)
    {
        itemNode = (ItemNodeState)obj;

        if (obj == null)
        {
        }
        else
        {
            EquipInfoPanel.instance.needMatDic.TryGetValue(itemNode.props_id, out needMat);

            matBtn.spriteName = itemNode.icon_name;

            //获取背包中所需材料的个数
            item = playerData.GetInstance().GetItemDatatByID(itemNode.props_id);

            //背包中是否有该材料
            if (null == item)
            {
                matBtn.text = 0 + "/" + needMat;
                isEnough    = false;
                matBtn.transform.Find("Label").GetComponent <UILabel>().color = Color.red;
            }
            else
            {
                //计算可合成数量
                //comCount = needMat / item.numb;

                matBtn.text = item.Count + "/" + needMat;

                if (item.Count >= needMat)
                {
                    isEnough = true;
                    matBtn.transform.Find("Label").GetComponent <UILabel>().color = Color.white;
                }
                else
                {
                    isEnough = false;
                    matBtn.transform.Find("Label").GetComponent <UILabel>().color = Color.red;
                }
            }

            if (EquipInfoPanel.instance.itemmatl.Contains(this))
            {
                EquipInfoPanel.instance.itemmatl.Remove(this);
            }

            EquipInfoPanel.instance.itemmatl.Add(this);
        }
    }
Esempio n. 14
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();
         }
     }
 }
Esempio n. 15
0
    public void InitData(EquipData equipdata)
    {
        ed = equipdata;
        if (null == ed)
        {
            return;
        }
        level.text          = ed.level + "级";
        iconFram.spriteName = UISign_in.GetspriteName(ed.grade);

        ItemNodeState itemnode = GameLibrary.Instance().ItemStateList[ed.id];

        if (null != itemnode)
        {
            icon.spriteName = itemnode.icon_name;
            if (1 == itemnode.types)
            {
                if (null != upGradeArrow)
                {
                    upGradeArrow.enabled    = isUpLv();
                    upGradeArrow.spriteName = GetArrowName(EquipDevelop.GetSingolton().table);
                }
            }
        }
        if (hintEffect == null)
        {
            hintEffect = transform.Find("UI_SS_JianTou_01");
        }
        if (hintEffect != null)
        {
            hintEffect.gameObject.SetActive(false);
            if (EquipDevelop.GetSingolton().table == 1)// EquipIntensifyPanel.instance.IsShow()
            {
                hintEffect.gameObject.SetActive(IsItemConditon());
            }
            else if (EquipDevelop.GetSingolton().table == 0) //(EquipStrengthePanel.instance.IsShow())
            {
                if (IsStrengeOneLv(0) && IsStrengeOneLv(1))
                {
                    hintEffect.gameObject.SetActive(true);
                }
                else
                {
                    hintEffect.gameObject.SetActive(false);
                }
            }
        }
    }
Esempio n. 16
0
 public void setData(ref ItemNodeState itemstate)
 {
     itemstate.props_id    = props_id;
     itemstate.name        = name;
     itemstate.types       = types;
     itemstate.describe    = describe;
     itemstate.grade       = grade;
     itemstate.cprice      = cprice;
     itemstate.sprice      = insprice;
     itemstate.skill_point = skill_point;
     itemstate.exp_gain    = exp_gain;
     itemstate.power_add   = power_add;
     itemstate.drop_fb     = drop_fb;
     itemstate.icon_name   = icon_name;
     itemstate.released    = released;
     itemstate.piles       = piles;
 }
Esempio n. 17
0
    public override void Info(object obj)
    {
        if (null == obj)
        {
            mailBtn.gameObject.SetActive(false);
            count.text = "";
        }
        else
        {
            rune = (ItemNodeState)obj;
            mailBtn.normalSprite = rune.icon_name;
            count.text           = playerData.GetInstance().GetItemCountById(rune.props_id).ToString();

            //if (playerData.GetInstance().runesDic.ContainsKey(rune.props_id))
            //    count.text = playerData.GetInstance().runesDic[rune.props_id].ToString();
        }
    }
Esempio n. 18
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);
            }
        }
        //获取索引值
    }
Esempio n. 19
0
    /// <summary>
    /// 装备信息和材料信息切换
    /// </summary>
    /// <param name="isShow"></param>
    public void HideEquipInfo(bool isShow, ItemNodeState item, int count)
    {
        itemMat   = item;
        matCountM = count;

        powerL.gameObject.SetActive(false);
        addPowerL.gameObject.SetActive(false);
        hitL.gameObject.SetActive(false);
        addHitL.gameObject.SetActive(false);

        if (!itemlist.Contains(item))
        {
            itemlist.Add(item);
            itemDic.Add(item, index);
            index++;
        }

        if (isShow)
        {
            MatComposite(item);
        }
        else
        {
            itemDic.TryGetValue(item, out ind);

            if (itemlist.Count > 1)
            {
                itemlist.RemoveRange(ind + 1, itemlist.Count);
            }
        }

        //材料
        eMatMultList.gameObject.SetActive(true);

        obj = new object[itemlist.Count];

        eMatMultList.InSize(itemlist.Count, 5);

        for (int i = 0; i < itemlist.Count; i++)
        {
            obj[i] = itemlist[i];
        }

        eMatMultList.Info(obj);
    }
Esempio n. 20
0
    void OpenRewards()
    {
        ItemData tempData = new ItemData();

        TaskManager.Single().itemlist.Clear();
        if (boxInfo[1] != 0)
        {
            tempData.GradeTYPE = GradeType.Purple;
            tempData.Name      = "金币";
            tempData.Describe  = "金币";
            tempData.Count     = boxInfo[1];
            tempData.IconName  = "jinbi";
            tempData.UiAtlas   = ResourceManager.Instance().GetUIAtlas("Prop");
        }
        else if (boxInfo[2] != 0)
        {
            tempData.GradeTYPE = GradeType.Orange;
            tempData.Name      = "钻石";
            tempData.Describe  = "钻石";
            tempData.IconName  = "zuanshi";
            tempData.Count     = boxInfo[2];
            tempData.UiAtlas   = ResourceManager.Instance().GetUIAtlas("Prop");
        }
        else if (boxInfo[3] != 0)
        {
            ItemNodeState item = GameLibrary.Instance().ItemStateList[boxInfo[3]];
            tempData.GradeTYPE = (GradeType)item.grade;
            tempData.Name      = item.name;
            tempData.Types     = item.types;
            tempData.Describe  = item.describe;
            tempData.IconName  = item.icon_name;
            tempData.Count     = boxInfo[4];
            if (item.types == 6 || item.types == 7)
            {
                tempData.UiAtlas = ResourceManager.Instance().GetUIAtlas("UIHeroHead");
            }
            else
            {
                tempData.UiAtlas = ResourceManager.Instance().GetUIAtlas("Prop");
            }
        }
        TaskManager.Single().itemlist.Add(tempData);
        Control.ShowGUI(UIPanleID.UITaskRewardPanel, EnumOpenUIType.DefaultUIOrSecond);
    }
Esempio n. 21
0
    public void RefreshUI(ItemNodeState item, int count)
    {
        gameObject.SetActive(true);
        ItemData.SetAngleMarking(soulStone, item.types);
        if (item.types == 6)
        {
            icon.atlas = ResourceManager.Instance().GetUIAtlas("UIHeroHead");
        }
        else
        {
            icon.atlas = ResourceManager.Instance().GetUIAtlas("Prop");
        }
        icon.spriteName = item.icon_name;
        name.text       = item.name;

        des.text           = "可能获得";
        countL.text        = "";
        borderS.spriteName = ItemData.GetFrameByGradeType((GradeType)item.grade);
    }
Esempio n. 22
0
    void CheckMaterial0()
    {
        ItemNodeState checkeitem = GameLibrary.Instance().ItemStateList[selectMaterial.syn_condition[0, 0]];

        if (checkeitem.syn_condition.Length > 0)
        {
            EquipDevelop.GetSingolton().equipIntensifyDlg.SetIntersifyData(EquipDevelop.GetSingolton().index + 1, checkeitem.props_id);
        }
        else
        {
            //如果没有合成材料显示出处面板
            //UIGoodsGetWayPanel.Instance.SetID(selectMaterial.syn_condition[0, 0]);
            //if (UILevel.instance.GetLevelData())
            //{
            //    Control.ShowGUI(GameLibrary.UIGoodsGetWayPanel);
            //}
            Control.ShowGUI(UIPanleID.UIGoodsGetWayPanel, EnumOpenUIType.DefaultUIOrSecond, false, selectMaterial.syn_condition[0, 0]);
        }
    }
Esempio n. 23
0
    protected override void ShowHandler()
    {
        if (INS == null)
        {
            long equpid = playerData.GetInstance().selectHeroDetail.equipSite[EquipDevelop.GetSingolton().index + 1].id;
            INS = GameLibrary.Instance().ItemStateList[equpid];
        }
        MaterialName.spriteName = INS.icon_name;
        MaterialIcon.spriteName = UISign_in.GetspriteName(INS.grade);
        if (int.Parse(INS.props_id.ToString().Substring(0, 3)) == 103)
        {
            debris.gameObject.SetActive(true);
        }
        else
        {
            debris.gameObject.SetActive(false);
        }

        if (int.Parse(INS.props_id.ToString().Substring(0, 3)) == 102)
        {
            HeroData  hd = playerData.GetInstance().GetHeroDataByID(Globe.selectHero.hero_id);
            EquipData ed;
            hd.equipSite.TryGetValue(HeroAndEquipNodeData.site, out ed);
            ItemNodeState ins = GameLibrary.Instance().ItemStateList[ed.id + 1];
            Debug.Log(localpos + "  ===>" + ed.id);
            if (ins != null)
            {
                if (localpos < ins.syn_condition.Length / 2)
                {
                    MaterialNum.text = playerData.GetInstance().GetItemCountById(ins.syn_condition[localpos, 0]) + "/" + ins.syn_condition[localpos, 1].ToString();
                }
                else
                {
                    Debug.Log(localpos + "  ===>" + ed.id);
                }
            }
        }
        else
        {
            Debug.Log(INS.props_id);
            MaterialNum.text = playerData.GetInstance().GetItemCountById(GameLibrary.Instance().ItemStateList[HeroAndEquipNodeData.Instance().GetReplaceNums(INS.props_id.ToString())].syn_condition[localpos, 0]) + "/" + GameLibrary.Instance().ItemStateList[HeroAndEquipNodeData.Instance().GetReplaceNums(INS.props_id.ToString())].syn_condition[localpos, 1].ToString();
        }
    }
Esempio n. 24
0
 void RefreshItem(GameObject item, long id, int count)
 {
     if (!GameLibrary.Instance().ItemStateList.ContainsKey(id))
     {
         return;
     }
     itemNode = GameLibrary.Instance().ItemStateList[id];
     if (itemNode.types == 6 || itemNode.types == 7)
     {
         item.transform.Find("Icon").GetComponent <UISprite>().atlas = ResourceManager.Instance().GetUIAtlas("UIHeroHead");
     }
     else
     {
         item.transform.Find("Icon").GetComponent <UISprite>().atlas = ResourceManager.Instance().GetUIAtlas("Prop");
     }
     ItemData.SetAngleMarking(item.transform.Find("Subscript").GetComponent <UISprite>(), itemNode.types);
     item.GetComponent <UISprite>().spriteName = ItemData.GetFrameByGradeType((GradeType)itemNode.grade);
     item.transform.Find("Icon").GetComponent <UISprite>().spriteName = itemNode.icon_name;
     item.transform.Find("Count").GetComponent <UILabel>().text       = "" + count;
 }
Esempio n. 25
0
 public void setData(ref ItemNodeState itemstate)
 {
     itemstate.props_id      = props_id;
     itemstate.name          = name;
     itemstate.types         = types;
     itemstate.describe      = describe;
     itemstate.grade         = grade;
     itemstate.next_grade    = next_grade;
     itemstate.cprice        = cprice;
     itemstate.sprice        = sprice;
     itemstate.syn_condition = syn_condition;
     itemstate.be_synth      = be_synth;
     itemstate.syn_cost      = syn_cost;
     itemstate.drop_fb       = drop_fb;
     //  icon_atlas = item["icon_atlas"].ToString();
     itemstate.icon_name = icon_name;
     itemstate.released  = released;
     // lv_limit = int.Parse(item["lv_limit"].ToString());
     itemstate.piles = piles;
 }
Esempio n. 26
0
    public void ShowPanel(ItemNodeState runeVO, bool isLeft, int site = -1)
    {
        this.rune   = runeVO;
        this.isLeft = isLeft;
        this.site   = site;

        if (isLeft)
        {
            detailsTab.gameObject.SetActive(false);
            wearBtn.transform.Find("Label").GetComponent <UILabel>().text = "卸下";
        }
        else
        {
            detailsTab.gameObject.SetActive(true);
            wearBtn.transform.Find("Label").GetComponent <UILabel>().text = "佩戴";
        }

        runeslvl.text   = runeVO.name;
        icon.spriteName = runeVO.icon_name;
        count.text      = playerData.GetInstance().GetItemCountById(runeVO.props_id).ToString();
        //playerData.GetInstance().runesDic[runeVO.props_id].ToString();
    }
Esempio n. 27
0
    public void Init(object info)
    {
        sceneEnter = transform.parent.parent.parent.GetComponent <UISceneEntry>();
        goodsTips  = sceneEnter.goodsTips.gameObject;

        infos = new int[((int[])info).Length];
        for (int i = 0; i < infos.Length; i++)
        {
            infos[i] = ((int[])info)[i];
        }

        item = GameLibrary.Instance().ItemStateList[long.Parse(((int[])info)[0].ToString())];

        if (item.types == 6)
        {
            icon.atlas = ResourceManager.Instance().GetUIAtlas("UIHeroHead");
        }

        ItemData.SetAngleMarking(soulStone, item.types);
        icon.spriteName    = item.icon_name;
        borderS.spriteName = ItemData.GetFrameByGradeType((GradeType)item.grade);
    }
Esempio n. 28
0
    public void setData(ref ItemNodeState itemstate)
    {
        itemstate.props_id          = props_id;
        itemstate.name              = name;
        itemstate.types             = types;
        itemstate.describe          = describe;
        itemstate.grade             = grade;
        itemstate.next_grade        = next_grade;
        itemstate.cprice            = cprice;
        itemstate.sprice            = sprice;
        itemstate.power             = power;             //力量加成
        itemstate.intelligence      = intelligence;      //智力加成
        itemstate.agility           = agility;           //敏捷加成
        itemstate.hp                = hp;                //生命值加成
        itemstate.attack            = attack;            //攻击加成
        itemstate.armor             = armor;             //护甲加成
        itemstate.magic_resist      = magic_resist;      //魔抗加成
        itemstate.critical          = critical;          //暴击加成
        itemstate.dodge             = dodge;             //闪避加成
        itemstate.hit_ratio         = hit_ratio;         //命中加成
        itemstate.armor_penetration = armor_penetration; //护甲穿透加成
        itemstate.magic_penetration = magic_penetration; //魔法穿透加成
        itemstate.suck_blood        = suck_blood;        //吸血加成
        itemstate.tenacity          = tenacity;          //韧性加成
        itemstate.movement_speed    = movement_speed;    //移动速度加成
        itemstate.attack_speed      = attack_speed;      //攻击速度加成
        itemstate.striking_distance = striking_distance; //攻击距离加成
        //itemstate.be_equip =be_equip;//可装备英雄
        //itemstate.be_synth =  be_synth;//可合成装备
        itemstate.syn_condition = syn_condition;//升级所需 用[id,数量]


        itemstate.syn_cost = syn_cost;
        itemstate.drop_fb  = drop_fb;
        //  icon_atlas = item["icon_atlas"].ToString();
        itemstate.icon_name = icon_name;
        itemstate.released  = released;
        itemstate.piles     = piles;
    }
Esempio n. 29
0
    /// <summary>
    /// 信息赋值
    /// </summary>
    /// <param name="obj"></param>
    public override void Info(object obj)
    {
        if (obj == null)
        {
            mailBtn.gameObject.SetActive(false);
            count.enabled = false;
        }
        else
        {
            itemNode = GameLibrary.Instance().ItemStateList[((ItemData)obj).Id];

            mailBtn.GetComponent <UISprite>().spriteName = itemNode.icon_name;
            count.text   = playerData.GetInstance().GetItemCountById(itemNode.props_id) + "";
            currentCount = playerData.GetInstance().GetItemCountById(itemNode.props_id);
            num.text     = "+" + GameLibrary.Instance().ItemStateList[itemNode.props_id].exp_gain.ToString() + "经验";
            propsData props = new propsData();
            props.id  = itemNode.props_id;
            props.num = GameLibrary.Instance().ItemStateList[itemNode.props_id].exp_gain * playerData.GetInstance().GetItemCountById(itemNode.props_id);
            propslist.Add(props);
            //propsDic.Add(itemNode.props_id, GameLibrary.Instance().ItemStateList[itemNode.props_id].exp_gain * playerData.GetInstance().GetItemCountById(itemNode.props_id));
        }
    }
Esempio n. 30
0
    bool IsItemCodition(ItemNodeState nextins, ref long money, ref Dictionary <long, ItemData> ItemDic)
    {
        ItemNodeState myNextins = nextins;
        long          matalid   = 0;
        long          cont      = 0;

        if (myNextins != null)
        {
            //钱不够了
            if (myNextins.syn_cost > money)
            {
                Ismoney = false;
                return(false);
            }

            for (long j = 0; j < myNextins.syn_condition.Length / 2; j++)
            {
                matalid = myNextins.syn_condition[j, 0];
                cont    = myNextins.syn_condition[j, 1];
                if (matalid != 0)
                {
                    if (GetItemCountById(matalid) < cont)
                    {
                        IsItemMaterialcondition = false;   //进化材料是否满足
                        noconditonMatalId       = matalid; //所缺材料id
                        return(false);                     //材料不够
                    }
                }
            }
        }
        else
        {
            return(false);
            //没有下一级了
        }
        money -= myNextins.syn_cost;
        //RemoveItemCount(matalid,(int)cont);//6件装备进化不会消耗相同的材料
        return(true);
    }