Exemplo n.º 1
0
    public void ClickChooseEquipItem(ItemeEquipOutSideChoose2cr item)
    {
        if (_preChooseEquipItem != null)
        {
            _preChooseEquipItem.UnSelect();
        }
        item.Select();
        _preChooseEquipItem = item;

        ConfigEquip equip = item.GetData();
        int         type  = equip.type;

        if (type != _currType)
        {
            tabBar.SelectTab(type - 1);
        }

        ItemeEquipOutSidecr itemeEquip = dataEquipt3.GetItem <ConfigEquip>("id", equip.id) as ItemeEquipOutSidecr;

        if (itemeEquip == null)
        {
            itemeEquip = dataEquipt2.GetItem <ConfigEquip>("id", equip.id) as ItemeEquipOutSidecr;
        }
        if (itemeEquip == null)
        {
            itemeEquip = dataEquipt1.GetItem <ConfigEquip>("id", equip.id) as ItemeEquipOutSidecr;
        }

        ClickItem(itemeEquip);
    }
Exemplo n.º 2
0
    void OnFillClick(GameObject go)
    {
        ItemeEquipOutSidecr item = EquipsOutsideView.Instance.GetSelectClickItem();

        if (item == null)
        {
            //TipManager.Instance.ShowTip("请选择要放进的装备",ColorEnum.White);
        }
        else
        {
            _isClose = false;
            btn_Closedcr.gameObject.SetActive(true);
            btn_Fillcr.gameObject.SetActive(false);
            _equip = item.GetData();
            SetData();
        }
    }
Exemplo n.º 3
0
    public void ClickItem(ItemeEquipOutSidecr itemEquip)
    {
        SetSynthesisViewVisble(true);
        if (lastClickItem != null)
        {
            lastClickItem.ClickItem(false);
        }
        lastClickItem = itemEquip;
        lastClickItem.ClickItem(true);
        ConfigEquip item = lastClickItem.GetData();

        text_Namecr.text = item.name;
        //Text_contcr.text = EquipManager.Instance.GetEquipDec(item);
        for (int i = 0; i < lastClickList.Count; i++)
        {
            lastClickList[i].SetLineInfo(0, 0, 0);
        }
        lastClickList.Clear();
        lastClickList.Add(lastClickItem);
        SetLineParentInfoHor(lastClickItem, 0);
        SetLineChildInfoHor(lastClickItem, 0);
    }
Exemplo n.º 4
0
    //设置line信息    三列的情况
    private void SetLineChildInfoHor(ItemeEquipOutSidecr setparent, int num)
    {
        ConfigEquip item = setparent.GetData();

        if (num > 3)
        {
            Log.Error("装备合成路径存在环策划查看配置" + item.id);
            return;
        }
        if (item.combine.Length > 0)
        {
            Vector3 parent  = setparent.gameObject.transform.localPosition;
            Vector3 Tops    = Vector3.zero;
            Vector3 Bottoms = Vector3.zero;
            num++;
            int selfCen             = 2;
            ItemeEquipOutSidecr par = dataEquipt2.GetItem <ConfigEquip>("id", item.id) as ItemeEquipOutSidecr;
            if (par == null)
            {
                par     = dataEquipt3.GetItem <ConfigEquip>("id", item.id) as ItemeEquipOutSidecr;
                selfCen = 3;
                if (par == null)
                {
                    selfCen = 1;
                }
            }
            for (int i = 0; i < item.combine.Length; i++)
            {
                int childCen            = 1;
                ItemeEquipOutSidecr ch1 = dataEquipt1.GetItem <ConfigEquip>("id", item.combine[i]) as ItemeEquipOutSidecr;
                if (ch1 == null)
                {
                    childCen = 2;
                    ch1      = dataEquipt2.GetItem <ConfigEquip>("id", item.combine[i]) as ItemeEquipOutSidecr;
                }
                if (ch1 != null && selfCen - childCen == 1)
                {
                    ch1.SetLineInfo(1, 0, 0);
                    Vector3 pos = setparent.gameObject.transform.InverseTransformPoint(ch1.gameObject.transform.position) + parent;
                    if (Tops != Vector3.zero)
                    {
                        if (pos.y > Tops.y)
                        {
                            Tops = pos;
                        }
                        if (pos.y < Bottoms.y)
                        {
                            Bottoms = pos;
                        }
                    }
                    else
                    {
                        Tops    = pos;
                        Bottoms = pos;
                    }
                    lastClickList.Add(ch1);
                    SetLineChildInfoHor(ch1, num);
                }
            }
            float length;
            float postion;
            if (Tops.y - Bottoms.y > 1)
            {
                if (parent.y > Tops.y)
                {
                    length = parent.y - Bottoms.y;
                }
                else if (parent.y < Bottoms.y)
                {
                    length = Tops.y - parent.y;
                }
                else
                {
                    length = Tops.y - Bottoms.y;
                }
                postion = ((Tops.y - parent.y) > 0 ? (Tops.y - parent.y) : 0) - length / 2;
            }
            else
            {
                length  = parent.y - Tops.y;
                postion = -length / 2;
                length  = Math.Abs(length);
            }
            if (Tops == Bottoms && Tops == Vector3.zero)
            {
                return;
            }
            setparent.SetLineInfo(2, length, postion);
        }
    }