Beispiel #1
0
    private void OnClickChindItem(ButtonScript obj, object args, int param1, int param2)
    {
        CompoundSkillCellUI cell = obj.GetComponent <CompoundSkillCellUI> ();

        //if (_selectChindObj == obj.gameObject)
        //return;
        if (_selectChindObj == null)
        {
            _selectChindObj = obj.gameObject;
            obj.GetComponent <CompoundSkillCellUI> ().arrow.gameObject.SetActive(true);
        }
        else
        {
            _selectChindObj.GetComponent <CompoundSkillCellUI> ().arrow.gameObject.SetActive(false);
            _selectChindObj = obj.gameObject;
            _selectChindObj.GetComponent <CompoundSkillCellUI> ().arrow.gameObject.SetActive(true);
        }

        if (cell == null)
        {
            return;
        }
        updateCompoundInfo(cell);
        updateCompoundPropInfo(cell);
    }
Beispiel #2
0
    private void OnGem(ButtonScript obj, object args, int param1, int param2)
    {
        if (_gemId != 0)
        {
            _gemItem.cellPane.gameObject.SetActive(false);
            _gemId          = 0;
            gemName.text    = "";
            gemNameLab.text = LanguageManager.instance.GetValue("inlaygem");
        }

        CompoundSkillCellUI cellUI = _selectChindObj.GetComponent <CompoundSkillCellUI> ();

        if (cellUI == null)
        {
            return;
        }
        if (MakeData.GetData(cellUI.MakeId).skillLevel >= 40 && !CompoundSystem.instance.GetIsOPenEquip((uint)cellUI.MakeId))
        {
            return;
        }
        if (gemPanel.gameObject.activeSelf)
        {
            return;
        }
        gemPanel.gameObject.SetActive(true);
        compoundList.SetActive(false);
        UpdataGemList();
    }
Beispiel #3
0
    public void UpdateNeedMakeItem(List <COM_DropItem> items)
    {
        CompoundSkillCellUI cell = _selectChindObj.GetComponent <CompoundSkillCellUI> ();

        if (cell == null)
        {
            return;
        }
        updateCompoundInfo(cell);
    }
Beispiel #4
0
    public void  updateCompoundPropInfo(CompoundSkillCellUI cell)
    {
        MakeData make = MakeData.GetData(cell.MakeId);

        if (make == null)
        {
            return;
        }
        ItemData itemData = ItemData.GetData(cell.MakeId);

        for (int k = 0; k < propCellList.Count; k++)
        {
            propCellList[k].transform.parent = null;
            propCellList[k].gameObject.SetActive(false);
            propCellPoolList.Add(propCellList[k]);
        }
        propCellList.Clear();



        GameObject djobj;

        if (propCellPoolList.Count > 0)
        {
            djobj = propCellPoolList[0];
            propCellPoolList.Remove(propCellPoolList[0]);
        }
        else
        {
            djobj = Object.Instantiate(propCell.gameObject) as GameObject;
        }
        djobj.transform.FindChild("skillName").GetComponent <UILabel> ().text = LanguageManager.instance.GetValue("dengji") + " " + itemData.level_;
        djobj.transform.FindChild("arrow").GetComponent <UISprite>().gameObject.SetActive(false);
        djobj.transform.parent     = propGrid.transform;
        djobj.transform.localScale = Vector3.one;
        djobj.SetActive(true);
        propCellList.Add(djobj);

        for (int i = 0; i < itemData.propArr.Count; i++)
        {
            GameObject obj;

            if (propCellPoolList.Count > 0)
            {
                obj = propCellPoolList[0];
                propCellPoolList.Remove(propCellPoolList[0]);
            }
            else
            {
                obj = Object.Instantiate(propCell.gameObject) as GameObject;
            }
            obj.transform.FindChild("skillName").GetComponent <UILabel>().text = LanguageManager.instance.GetValue(itemData.propArr[i].Key.ToString()) + " "
                                                                                 + itemData.propArr[i].Value[0].ToString() + "-" + itemData.propArr[i].Value[1].ToString() + " ";
            obj.transform.FindChild("arrow").GetComponent <UISprite>().gameObject.SetActive(false);
            obj.transform.parent     = propGrid.transform;
            obj.transform.localScale = Vector3.one;
            obj.SetActive(true);
            propCellList.Add(obj);
        }
        propGrid.Reposition();


        ItemData itemD = ItemData.GetData(MakeData.GetData(_selectSkillCell.MakeId).specialID_);

        if (itemD == null)
        {
            return;
        }

        for (int i = 0; i < itemD.propArr.Count; i++)
        {
            GameObject Pobj;

            if (propCellPoolList.Count > 0)
            {
                Pobj = propCellPoolList[0];
                propCellPoolList.Remove(propCellPoolList[0]);
            }
            else
            {
                Pobj = Object.Instantiate(propCell.gameObject) as GameObject;
            }
            Pobj.transform.FindChild("skillName").GetComponent <UILabel>().text = LanguageManager.instance.GetValue(itemD.propArr[i].Key.ToString()) + " "
                                                                                  + itemD.propArr[i].Value[0].ToString() + "-" + itemD.propArr[i].Value[1].ToString() + " ";
            Pobj.transform.FindChild("arrow").GetComponent <UISprite>().gameObject.SetActive(true);
            Pobj.transform.parent     = PBpropGrid.transform;
            Pobj.transform.localScale = Vector3.one;
            Pobj.SetActive(true);
            propCellList.Add(Pobj);
        }
        PBpropGrid.Reposition();
    }
Beispiel #5
0
    public void  updateCompoundInfo(CompoundSkillCellUI cell)
    {
        CompoundInfoObj.SetActive(true);
        //if(_selectSkillCell !=  null)
        //{
        //	_selectSkillCell.arrow.gameObject.SetActive(false);
        //}

        _selectSkillCell = cell;
        //	_selectSkillCell.arrow.gameObject.SetActive(true);
        //skillNameLab.text = cell.nameLab.text;
        MakeData make = MakeData.GetData(cell.MakeId);

        if (make == null)
        {
            return;
        }
        ItemData itemData = ItemData.GetData(cell.MakeId);

        if (itemData == null)
        {
            return;
        }
        compoundIcon.gameObject.SetActive(true);
        if (_compoundItem == null)
        {
            _compoundItem          = UIManager.Instance.AddItemCellUI(compoundIcon, (uint)itemData.id_);
            _compoundItem.showTips = true;
        }
        else
        {
            _compoundItem.itemId = (uint)itemData.id_;
        }
        InlayGem.gameObject.SetActive(true);
        compoundItemName.text  = itemData.name_;
        compoundItemLevel.text = itemData.level_.ToString();
        needMoneyLab.text      = make.needMoney.ToString();


        /*	if(itemData.propArr.Count > 0)
         *      {
         *              compoundItemProp.text = "";
         *              for(int i=0;i<itemData.propArr.Count;i++)
         *              {
         *                      compoundItemProp.text += LanguageManager.instance.GetValue(itemData.propArr[i].Key.ToString())+" "
         +itemData.propArr[i].Value[0].ToString()+"-"+itemData.propArr[i].Value[1].ToString() + " ";
         *              }
         *      }
         *      else
         *      {
         *              compoundItemProp.gameObject.SetActive(false);
         *      }
         */



        foreach (UITexture v in needItemsIcon)
        {
            v.gameObject.SetActive(false);
        }

        isItemEnough          = true;
        compoundBtn.isEnabled = true;
        for (int i = 0; i < make.needItems.Length; i++)
        {
            ItemData needItem = ItemData.GetData(int.Parse(make.needItems[i]));
            if (needItem == null)
            {
                return;
            }
            needItemsIcon[i].gameObject.SetActive(true);
            HeadIconLoader.Instance.LoadIcon(needItem.icon_, needItemsIcon[i]);

            if (!_icons.Contains(needItem.icon_))
            {
                _icons.Add(needItem.icon_);
            }

            needItemsIcon[i].name = needItem.id_.ToString();
            int itemCount = BagSystem.instance.GetItemMaxNum(uint.Parse(make.needItems[i]));

            needItemsIcon[i].gameObject.transform.Find("num").GetComponent <UILabel>().text  = itemCount + "/" + make.needItemNum[i];
            needItemsIcon[i].gameObject.transform.Find("num").GetComponent <UILabel>().color = Color.white;
            needItemsIcon[i].gameObject.transform.Find("name").GetComponent <UILabel>().text = needItem.name_;

            if (itemCount < int.Parse(make.needItemNum[i]))
            {
                needItemsIcon[i].gameObject.transform.Find("num").GetComponent <UILabel>().color = Color.red;
                isItemEnough          = false;
                compoundBtn.isEnabled = false;
            }
            if (make.skillLevel > GamePlayer.Instance.GetIprop(PropertyType.PT_Level))
            {
                compoundBtn.isEnabled = false;
            }
            if (make.needMoney > GamePlayer.Instance.GetIprop(PropertyType.PT_Money))
            {
                compoundBtn.isEnabled = false;
            }
        }


        if (make.skillLevel >= 40 && !CompoundSystem.instance.GetIsOPenEquip((uint)cell.MakeId))
        {
            peifangInfo.gameObject.SetActive(true);
            ItemData pItem = ItemData.GetData(make.needBook_);
            if (pItem != null)
            {
                peifangLab.text  = LanguageManager.instance.GetValue("xuyaopeifang").Replace("{n}", pItem.name_);
                peifangIcon.name = pItem.id_.ToString();
                HeadIconLoader.Instance.LoadIcon(pItem.icon_, peifangIcon);


                if (_gemId != 0)
                {
                    _gemItem.cellPane.gameObject.SetActive(false);
                    _gemId          = 0;
                    gemName.text    = "";
                    gemNameLab.text = LanguageManager.instance.GetValue("inlaygem");
                    gemInfoObj.gameObject.SetActive(false);
                }
            }
            compoundBtn.isEnabled = false;
        }
        else
        {
            peifangInfo.gameObject.SetActive(false);
        }

        GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_MainMakeSubDetail, compoundBtn.isEnabled == true? 1: 0);
    }
Beispiel #6
0
    private void OnSkillCell(ButtonScript obj, object args, int param1, int param2)
    {
        if (_chindItemCellObj != null && _chindItemCellObj != obj)
        {
            _chindItemCellObj.transform.FindChild("bg").FindChild("arrows").GetComponent <UISprite>().spriteName = "sanjiao";
            _chindItemCellObj = null;
        }

        if (obj.transform.FindChild("bg").FindChild("arrows").GetComponent <UISprite>().spriteName == "sanjiao2")
        {
            obj.transform.FindChild("bg").FindChild("arrows").GetComponent <UISprite>().spriteName = "sanjiao";
            foreach (GameObject c in chindCellList)
            {
                skillGrid.RemoveChild(c.transform);
                c.transform.parent = null;
                c.gameObject.SetActive(false);
                chindCellPoolList.Add(c);
            }
            chindCellList.Clear();
            _chindItemCellObj = null;
            return;
        }
        else
        {
            obj.transform.FindChild("bg").FindChild("arrows").GetComponent <UISprite>().spriteName = "sanjiao2";

            foreach (GameObject c in chindCellList)
            {
                skillGrid.RemoveChild(c.transform);
                c.transform.parent = null;
                c.gameObject.SetActive(false);
                chindCellPoolList.Add(c);
            }
            chindCellList.Clear();

            _chindItemCellObj = obj;
        }

        int indx   = skillGrid.GetIndex(obj.transform);
        int pLevel = param1;        // GamePlayer.Instance.GetIprop (PropertyType.PT_Level) / 10 + 1;

        if (pLevel == 1)
        {
            pLevel = 0;
        }
        int  index    = 0;
        bool jobFirst = false;


        Profession pro = Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel));

        ItemSubType[] items = pro.CanUsedItems(GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel) * 2 + 2);

        foreach (MakeData m in MakeData.metaData.Values)
        {
            if (_bJobEquip)
            {
                if ((pLevel <= m.skillLevel && m.skillLevel <= pLevel + 9) && m.type_ == "Player")
                {
                    for (int i = 0; i < items.Length; i++)
                    {
                        if (ItemData.GetData(m.itemId_).subType_ == items[i])
                        {
                            GameObject objCell = null;
                            if (chindCellPoolList.Count > 0)
                            {
                                objCell = chindCellPoolList[0];
                                chindCellPoolList.Remove(objCell);
                            }
                            else
                            {
                                objCell = Object.Instantiate(chindItemCell.gameObject) as GameObject;
                            }

                            UIManager.SetButtonEventHandler(objCell, EnumButtonEvent.OnClick, OnClickChindItem, 0, 0);
                            CompoundSkillCellUI cell = objCell.GetComponent <CompoundSkillCellUI>();
                            cell.SkillId = m.skillId;
                            cell.MakeId  = m.itemId_;
                            cell.gameObject.transform.FindChild("bg").FindChild("recommend").GetComponent <UISprite>().gameObject.SetActive(true);
                            skillGrid.AddChild(objCell.transform, ++indx);
                            objCell.SetActive(true);
                            objCell.transform.localScale = Vector3.one;
                            chindCellList.Add(objCell);

                            if (jobFirst == false && i == 0)
                            {
                                GuideManager.Instance.RegistGuideAim(objCell, GuideAimType.GAT_MainMakeSubFirst);
                            }
                            if (jobFirst == false)
                            {
                                jobFirst = true;
                            }
                        }
                    }
                }
            }
            else
            {
                if ((ItemData.GetData(m.itemId_).slot_ == (EquipmentSlot)_selectEquipType ||
                     ((EquipmentSlot)_selectEquipType == EquipmentSlot.ES_SingleHand &&
                      ItemData.GetData(m.itemId_).slot_ == EquipmentSlot.ES_DoubleHand)) &&
                    (pLevel <= m.skillLevel && m.skillLevel <= pLevel + 9) && m.type_ == "Player")
                {
                    GameObject objCell = null;
                    if (chindCellPoolList.Count > 0)
                    {
                        objCell = chindCellPoolList[0];
                        chindCellPoolList.Remove(objCell);
                    }
                    else
                    {
                        objCell = Object.Instantiate(chindItemCell.gameObject) as GameObject;
                    }

                    UIManager.SetButtonEventHandler(objCell, EnumButtonEvent.OnClick, OnClickChindItem, 0, 0);
                    CompoundSkillCellUI cell = objCell.GetComponent <CompoundSkillCellUI>();
                    cell.SkillId = m.skillId;
                    cell.MakeId  = m.itemId_;
                    skillGrid.AddChild(objCell.transform, ++indx);
                    objCell.SetActive(true);
                    objCell.transform.localScale = Vector3.one;
                    chindCellList.Add(objCell);
                    if (index == 0)
                    {
                        GuideManager.Instance.RegistGuideAim(objCell, GuideAimType.GAT_MainMakeSubFirst);
                    }

                    if (index == 2)
                    {
                        GuideManager.Instance.RegistGuideAim(objCell, GuideAimType.GAT_MainMakeSubSecond);
                    }

                    if (index == 4)
                    {
                        GuideManager.Instance.RegistGuideAim(objCell, GuideAimType.GAT_MainMakeSubThird);
                    }
                    index++;
                }
            }
        }
        GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_MainMakeSub, GamePlayer.Instance.GetIprop(PropertyType.PT_Profession));
    }
Beispiel #7
0
    private void SelectItem()
    {
        levelBtnCellList[0].gameObject.transform.FindChild("arrows").GetComponent <UISprite>().spriteName = "sanjiao2";
        int indx   = skillGrid.GetIndex(levelBtnCellList[0].gameObject.transform);
        int pLevel = 1;        // GamePlayer.Instance.GetIprop (PropertyType.PT_Level) / 10 + 1;

        if (pLevel == 1)
        {
            pLevel = 0;
        }

        Profession pro = Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel));

        ItemSubType[] items = pro.CanUsedItems(GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel) * 2 + 2);

        foreach (MakeData m in MakeData.metaData.Values)
        {
            if ((pLevel <= m.skillLevel && m.skillLevel <= pLevel + 9) && m.type_ == "Player")
            {
                for (int i = 0; i < items.Length; i++)
                {
                    if (ItemData.GetData(m.itemId_).subType_ == items[i])
                    {
                        GameObject objCell = null;
                        if (chindCellPoolList.Count > 0)
                        {
                            objCell = chindCellPoolList[0];
                            chindCellPoolList.Remove(objCell);
                        }
                        else
                        {
                            objCell = Object.Instantiate(chindItemCell.gameObject) as GameObject;
                        }

                        UIManager.SetButtonEventHandler(objCell, EnumButtonEvent.OnClick, OnClickChindItem, 0, 0);
                        CompoundSkillCellUI cell = objCell.GetComponent <CompoundSkillCellUI>();
                        cell.SkillId = m.skillId;
                        cell.MakeId  = m.itemId_;
                        cell.gameObject.transform.FindChild("recommend").GetComponent <UISprite>().gameObject.SetActive(true);
                        skillGrid.AddChild(objCell.transform, ++indx);
                        objCell.SetActive(true);
                        objCell.transform.localScale = Vector3.one;
                        chindCellList.Add(objCell);
                    }
                }
            }
        }


        CompoundSkillCellUI cell1 = chindCellList[0].gameObject.GetComponent <CompoundSkillCellUI> ();

        if (_selectChindObj == chindCellList[0].gameObject)
        {
            return;
        }
        if (_selectChindObj == null)
        {
            _selectChindObj = chindCellList[0].gameObject;
            chindCellList[0].GetComponent <CompoundSkillCellUI> ().arrow.gameObject.SetActive(true);
        }
        else
        {
            _selectChindObj.GetComponent <CompoundSkillCellUI> ().arrow.gameObject.SetActive(false);
            _selectChindObj = chindCellList[0].gameObject;
            _selectChindObj.GetComponent <CompoundSkillCellUI> ().arrow.gameObject.SetActive(true);;
        }

        if (cell1 == null)
        {
            return;
        }
        updateCompoundInfo(cell1);
        updateCompoundPropInfo(cell1);
    }