void onClick_StrengthenSuitBtn_Btn(GameObject caster)
    {
        SuitPanelParam param = new SuitPanelParam()
        {
            m_type = SuitPanelParam.SuitType.Strengthen,
            vec    = new Vector3(-36.47f, 140.8f, 0),
        };

        DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.GridStrengthenSuitPanel, data: param);
    }
Example #2
0
    void onClick_BtnStoneSuitActive_Btn(GameObject caster)
    {
        SuitPanelParam param = new SuitPanelParam()
        {
            m_type  = SuitPanelParam.SuitType.Stone,
            vec     = new Vector3(133.8f, 201.31f, 0),
            isOther = true,
        };

        DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.GridStrengthenSuitPanel, data: param);
    }
    protected override void OnShow(object data)
    {
        base.OnShow(data);
        RegisterGlobalEvent(true);

        Vector3 pos = Vector3.zero;

        if (null != data && data is SuitPanelParam)
        {
            SuitPanelParam par = (SuitPanelParam)data;
            pos           = (Vector3)par.vec;
            m_CurType     = par.m_type;
            isOtherPlayer = par.isOther;
        }
        if (null != m_trans_Content)
        {
            m_trans_Content.transform.localPosition = pos;
        }
        StrengthenDataDes.Clear();
        m_lstSuitLv.Clear();
        if (isOtherPlayer)
        {
            ViewPlayerData retData = ViewPlayerData.GetViewPlayerData();
            if (retData == null)
            {
                return;
            }
            List <GemInlayList>  gem_data     = retData.gem_data;
            List <StrengthList>  strengthList = retData.strengthList;
            List <ItemSerialize> itemList     = retData.itemList;
            List <uint>          tempStrength = new List <uint>();
            #region 宝石等级
            ActiveStoneSuitLv = 0;
            for (int i = 0; i < gem_data.Count; i++)
            {
                uint itemID             = gem_data[i].base_id;
                table.ItemDataBase item = GameTableManager.Instance.GetTableItem <table.ItemDataBase>(itemID);
                if (item != null)
                {
                    ActiveStoneSuitLv += item.grade;
                }
            }
            #endregion
            #region 颜色等级
            ActiveColorSuitLv = 0;
            List <BaseItem> items = new List <BaseItem>();
            for (int i = 0; i < itemList.Count; i++)
            {
                BaseItem baseItem = new BaseItem(itemList[i].dwObjectID, itemList[i]);
                if (baseItem != null)
                {
                    if (baseItem.EquipColor >= EquipDefine.EquipColor.Orange)
                    {
                        items.Add(baseItem);
                    }
                }
            }
            for (int j = 0; j < colors.Count; j++)
            {
                uint count = 0;
                for (int x = 0; x < items.Count; x++)
                {
                    if (items[x].Grade >= colors[j].grade)
                    {
                        count++;
                    }
                }
                if (count >= colors[j].equip_num)
                {
                    ActiveColorSuitLv = colors[j].level;
                }
            }
            #endregion
            #region 套装强化等级
            ActiveStrengthenSuitLv = 0;
            List <GridStrengthenSuitDataBase> StrengthenDataBase = GameTableManager.Instance.GetTableList <GridStrengthenSuitDataBase>();

            for (int i = 0; i < StrengthenDataBase.Count; i++)
            {
                if (StrengthenDataBase[i].job == retData.job)
                {
                    uint matchNum = 0;
                    m_lstSuitLv.Add(StrengthenDataBase[i].suitlv);
                    StrengthenDataDes.Add(StrengthenDataBase[i].des);
                    for (int j = 0; j < strengthList.Count; j++)
                    {
                        if (strengthList[j].level >= StrengthenDataBase[i].triggerStrengLv)
                        {
                            matchNum++;
                        }
                    }
                    if (matchNum >= StrengthenDataBase[i].triggerPosNum)
                    {
                        ActiveStrengthenSuitLv = StrengthenDataBase[i].suitlv;
                    }
                }
            }

            #endregion
        }
        else
        {
            ActiveStrengthenSuitLv = DataManager.Manager <EquipManager>().ActiveStrengthenSuitLv;
            ActiveColorSuitLv      = DataManager.Manager <EquipManager>().ActiveColorSuitLv;
            ActiveStoneSuitLv      = DataManager.Manager <EquipManager>().ActiveStoneSuitLv;
            m_lstSuitLv.AddRange(DataManager.Manager <EquipManager>().CurGroupSuitData.GetStrengthenLvDatas());
            for (int i = 0; i < m_lstSuitLv.Count; i++)
            {
                string des = DataManager.Manager <EquipManager>().CurGroupSuitData.GetLocalStrengthenData(m_lstSuitLv[i]).Des;
                StrengthenDataDes.Add(des);
            }
        }
        CreateData();
    }