예제 #1
0
 public void RefreshUID(ArenaHero hero = null)
 {
     if (null == hero)
     {
         playerName.text = "";
         rankL.text      = "排名:";
         lvlL.text       = "等级:";
         fcL.text        = "战力:";
         SetHeroPos(1);
         for (int i = 0; i < HeroList.Length; i++)
         {
             RefreshIcon(HeroList[i], null);
         }
         dearBtn.isEnabled = false;
         dearBtn.SetState(GUISingleButton.State.Disabled);
         //gameObject.SetActive(false);
         return;
     }
     //gameObject.SetActive(true);
     this.hero       = hero;
     pid             = hero.pid;
     playerName.text = hero.nm;
     rankL.text      = "排名:" + hero.rk;
     lvlL.text       = "等级:" + hero.lvl;
     fcL.text        = "战力:" + hero.fc;
     //Globe.InitHeroSort(hero.herolist);
     SetHeroPos(hero.heroState);
     RefreshData(hero.heroState, hero.herolist);
     dearBtn.isEnabled = true;
     dearBtn.SetState(GUISingleButton.State.Normal);
 }
예제 #2
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);
            }
        }
        //获取索引值
    }
예제 #3
0
    public void AddRaidsItem(object[] item, object[] other, SceneNode sn)
    {
        this.other = null;
        this.item  = new object[null != other ? item.Length + 1 : item.Length];
        for (int i = 0; i < item.Length; i++)
        {
            this.item[i] = item[i];
        }

        if (null != other)
        {
            this.item[this.item.Length - 1] = other;
            this.other = other;
        }

        itemIndex  = 0;
        raidsCount = 0;

        scrollView.ResetPosition();
        ClearItemGrid();
        itemPos = new Vector3(-21, 0, 0);
        InvokeRepeating("ShowItemRaids", 0, 0.5f);

        sceneNode = sn;
        if (null == SceneEntry)
        {
            SceneEntry = transform.parent.GetComponent <UISceneEntry>();
        }
        raidsBtn.SetState(GUISingleButton.State.Normal);
        backBtn.isEnabled = false;
        SetBtnStateCollider(false);

        if (SceneEntry.type != OpenSourceType.Dungeons)
        {
            GameLibrary.eventdList[(sn.bigmap_id - 30000) / 100] -= SceneEntry.CleanoutCount;
            //SceneEntry.RefreshUI(sn);
            Control.ShowGUI(UIPanleID.SceneEntry, EnumOpenUIType.DefaultUIOrSecond, false, sn);
            raidsBtn.isEnabled = GameLibrary.eventdList[(sceneNode.bigmap_id - 30000) / 100] <= 0 ? false : true;
        }
    }
예제 #4
0
    public void Flopped(int[] dn)
    {
        if (flopNoShow)
        {
            return;
        }
        if (dn.Length > 1 || currentFlopCount == MAX_FLOP)
        {
            for (int j = 0; j < flopCardItems.Length; j++)
            {
                if (!flopCardItems[j].flopped)
                {
                    DoFlop(flopCardItems[j]);
                }
            }
        }
        else
        {
            DoFlop(cardToFlop);
        }

        LaMyDiamond.text = "" + playerDiamond;
        if (currentFlopCount <= MAX_FLOP)
        {
            for (int i = 0; i < flopCardItems.Length; i++)
            {
                if (!flopCardItems[i].flopped)
                {
                    flopCardItems[i].RefreshPrice(flopItems[currentFlopCount - 1].cost);
                }
            }
            AllPrice.text = "" + GetAllCost();
        }
        else
        {
            BtnFlopAll.SetState(GUISingleButton.State.Disabled);
            AllPrice.text = "0";
        }
    }
예제 #5
0
    public void InitData(EquipData equidata)
    {
        ed = equidata;
        if (ed == null)
        {
            return;
        }
        ins = GameLibrary.Instance().ItemStateList[ed.id];
        if (ins.next_grade != 0)
        {
            nexins = GameLibrary.Instance().ItemStateList [ins.next_grade];
        }
        else
        {
            nexins = null;
        }

        //currentEquipName.text = ins.name;
        currentEquipName.text  = GoodsDataOperation.GetInstance().JointEquipNameColour(ins.name, (GradeType)ins.grade);
        currentIcon.spriteName = ins.icon_name;
        curentFram.spriteName  = UISign_in.GetspriteName(ed.grade);

        if (nexins != null)
        {
            nextFram.spriteName = UISign_in.GetspriteName(ed.grade + 1);
            nextIcon.spriteName = nexins.icon_name;
            //nextEquipName.text = nexins.name;
            nextEquipName.text = GoodsDataOperation.GetInstance().JointEquipNameColour(nexins.name, (GradeType)(nexins.grade));
            nextFram.gameObject.SetActive(true);
        }
        else
        {
            nextFram.gameObject.SetActive(false);
            nextEquipName.text = "";
        }


        nextEquipLv.text = currentEquiplv.text = ed.level + "级";
        ItemNodeState needMatal;
        long          matalid;
        int           numbcount = 0;

        if (nexins != null)
        {
            for (long i = 0; i < 3; i++)
            {
                if (i < nexins.syn_condition.Length / 2)
                {
                    matalid = nexins.syn_condition [i, 0];
                    if (matalid != 0)
                    {
                        matalFram [i].gameObject.SetActive(true);

                        needMatal = GameLibrary.Instance().ItemStateList [matalid];
                        if (needMatal.types == 1)
                        {
                            matalIcon [i].AtlasName = ResourceManager.Instance().GetUIAtlas("UIEquip");
                        }
                        else
                        {
                            matalIcon [i].AtlasName = ResourceManager.Instance().GetUIAtlas("Prop");
                        }
                        matalFram [i].spriteName = UISign_in.GetspriteName(needMatal.grade);
                        matalIcon [i].spriteName = needMatal.icon_name;
                        if (GoodsDataOperation.GetInstance().GetItemCountById(matalid) >= nexins.syn_condition [i, 1])
                        {
                            needNumb [i].color = Color.white;
                        }
                        else
                        {
                            needNumb [i].color = Color.red;
                        }
                        numbcount = 0;
                        if (playerData.GetInstance().baginfo.ItemDic.ContainsKey(matalid))
                        {
                            numbcount = playerData.GetInstance().baginfo.ItemDic [matalid].Count;
                        }
                        needNumb [i].text = numbcount + "/" + nexins.syn_condition [i, 1].ToString();
                    }
                    else
                    {
                        matalFram [i].gameObject.SetActive(false);
                    }
                }
                else
                {
                    matalFram [i].gameObject.SetActive(false);
                }
            }
        }
        else
        {
            for (long i = 0; i < 3; i++)
            {
                matalFram [i].gameObject.SetActive(false);
            }
        }
        //当前装备
        // ItemNodeState item = GameLibrary.Instance().ItemStateList[ed.id];

        //基础装备
        // long baseid = ed.id / 100 * 100;
        ItemNodeState baseItem = GameLibrary.Instance().ItemStateList[ed.baseId];

        short[] basepropertys = baseItem.propertylist;
        short[] propertys     = ins.propertylist;
        short[] nexpropers    = null;
        if (nexins != null)
        {
            nexpropers = nexins.propertylist;
        }
        if (basepropertys == null)
        {
            return;
        }
        //int index = 0;
        string name                   = "";
        string currentattrstr         = "";
        string nextlvIncreasseAttrstr = "";

        for (int i = 0; i < basepropertys.Length; i++)
        {
            if (basepropertys[i] > 0)
            {
                name           += propertyname[i] + "\n";
                currentattrstr += (basepropertys[i] + propertys[i] * ed.level).ToString() + "\n";
                if (nexpropers != null)
                {
                    float increaseVal = (nexpropers[i] - propertys[i]) * ed.level;
                    nextlvIncreasseAttrstr += "+ " + increaseVal.ToString() + "\n";
                }
            }
        }
        allGoldLab.text = CalculateAllMoney().ToString(); //所有进化的消耗金币
        IsItemConditon();                                 //判断是否满足进化条件
        if (IsItemMaterialcondition && nexins != null)    //材料满足时亮起
        {
            //redPoint.gameObject.SetActive(true);
            Intensify.SetState(GUISingleButton.State.Normal);
            Intensify.onClick = EquipEvolve;
        }
        else
        {
            //redPoint.gameObject.SetActive(false);
            Intensify.SetState(GUISingleButton.State.Disabled);
            Intensify.onClick = null;
        }
        //全部进化按钮显示判断
        if (IsHaveMaterial())
        {
            allEvolvesBtn.SetState(GUISingleButton.State.Normal);
            allEvolvesBtn.onClick = AllEvolvesClick;
        }
        else
        {
            allEvolvesBtn.SetState(GUISingleButton.State.Disabled);
            allEvolvesBtn.onClick = null;
        }

        attrL.text = name;
        attrM.text = currentattrstr;
        attrR.text = nextlvIncreasseAttrstr;
        if (nexins != null)
        {
            needMoney.gameObject.SetActive(true);
            needMoney.text = nexins.syn_cost.ToString();
            if (nexins.syn_cost <= playerData.GetInstance().baginfo.gold)
            {
                needMoney.color = Color.white;
            }
            else
            {
                needMoney.color = Color.red;
            }
        }
        else
        {
            needMoney.gameObject.SetActive(false);
        }
    }
예제 #6
0
    public void InitData(EquipData equipitem)
    {
        ed = equipitem;
        if (ed != null)
        {
            selectEquip.InitData(ed);
            currentLv.text = ed.level.ToString() + "级";
            nextLv.text    = (ed.level + 1).ToString() + "级";
        }
        //当前装备
        ItemNodeState item = GameLibrary.Instance().ItemStateList[ed.id];

        if (null != item)
        {
            //equipname.text = item.name;
            equipname.text = GoodsDataOperation.GetInstance().JointEquipNameColour(item.name, (GradeType)ed.grade);
        }
        //基础装备
        long          baseid   = ed.id / 100 * 100;
        ItemNodeState baseItem = GameLibrary.Instance().ItemStateList[baseid];

        short[] basepropertys = baseItem.propertylist;
        short[] propertys     = item.propertylist;
        if (basepropertys == null)
        {
            return;
        }
        int    index          = 0;
        string name           = "";
        string currentattrstr = "";
        string nextlvattrstr  = "";

        for (int i = 0; i < basepropertys.Length; i++)
        {
            if (basepropertys[i] > 0)
            {
                name           += propertyname[i] + "\n";
                currentattrstr += (basepropertys[i] + propertys[i] * ed.level).ToString() + "\n";
                nextlvattrstr  += "+ " + propertys[i].ToString() + "\n";
            }
        }
        EquipStrenAttrname.text   = name;
        equipstrenAttrMiddle.text = currentattrstr;
        EquipStrenAttrRight.text  = nextlvattrstr;
        oneLvconst            = GetStrenthOne(ed);
        EquipOneLvCost.text   = oneLvconst.ToString();
        toLvConst             = StrengeToLvCost();
        EquipToLvCost.text    = toLvConst.ToString();
        allEquopToLvCost.text = AllStrengeToLvCost().ToString();
        if (!IsStrengeOneLv(0))
        {
            strengeOnebtn.SetState(GUISingleButton.State.Disabled);
            strengeToLv.SetState(GUISingleButton.State.Disabled);
            //oneStrengthRed.gameObject.SetActive(false);
            //allStrengthRed.gameObject.SetActive(false);
        }
        else
        {
            strengeOnebtn.SetState(GUISingleButton.State.Normal);
            strengeToLv.SetState(GUISingleButton.State.Normal);
            //oneStrengthRed.gameObject.SetActive(true);
            //allStrengthRed.gameObject.SetActive(true);
        }
        //全部按钮显示判断
        //if (long.Parse(allEquopToLvCost.text) > 0)
        //{
        //    strengAllEquipBtn.SetState(GUISingleButton.State.Normal);
        //}
        //else
        //{
        //    strengAllEquipBtn.SetState(GUISingleButton.State.Disabled);
        //}
        strengeOnebtn.onClick     = StrengeOneLv; //强化一次
        strengeToLv.onClick       = StrengeToLv;  //一键强化,强化多次
        strengAllEquipBtn.onClick = StrengeAllToLv;
    }