//坐骑灵性配置config
        private void GetRideGiftConig()
        {
            List <SXML> xml = XMLMgr.instance.GetSXMLList("ride.gift_info");

            foreach (SXML x in xml)
            {
                RideGiftConfigVo lvlvo = new RideGiftConfigVo();

                lvlvo.attMaping = new Dictionary <int, List <AttConfigVo> >();

                lvlvo.lvl = x.getInt("lvl");
                lvlvo.num = x.getInt("num");

                List <SXML> typeLst = x.GetNodeList("gift_type");

                foreach (SXML currGift in typeLst)
                {
                    int type = currGift.getInt("type");

                    List <AttConfigVo> attLst = new List <AttConfigVo>();

                    foreach (SXML _x in currGift.GetNodeList("att"))
                    {
                        AttConfigVo att = new AttConfigVo();

                        att.att_type = _x.getInt("att_type");

                        att.add = _x.getInt("add");

                        attLst.Add(att);
                    }

                    if (lvlvo.attMaping.ContainsKey(type))
                    {
                        lvlvo.attMaping[type] = attLst;
                    }
                    else
                    {
                        lvlvo.attMaping.Add(type, attLst);
                    }
                }

                AddMapping(lvlvo.lvl, rideGiftMapping, lvlvo);
            }
        }
Example #2
0
        private void SetRideGiftData(uint type)
        {
            var giftVo = A3_RideModel.getInstance().GetRideInfo().giftMapping[type];

            _ridename.text = ContMgr.getCont("gift_type" + type);
            _lvl.text      = giftVo.lvl.ToString();

            if (_golst == null)
            {
                _golst     = new List <GameObject>();
                _nextgolst = new List <GameObject>();
            }

            RideGiftConfigVo configVo = A3_RideModel.getInstance().GetValueByType <RideGiftConfigVo>((int)giftVo.lvl);

            needNum = configVo.num;

            _needNumText.text = configVo.num.ToString();

            var id = A3_RideModel.getInstance().GetUpGradeGiftItemId();

            haveNum = a3_BagModel.getInstance().getItemNumByTpid(id);

            _haveNumText.text = haveNum.ToString();

            BuildGo(configVo.attMaping[(int)type], _golst, _parentGo);

            _nextContainer.SetActive(configVo.num != -1);

            _btnContainer.gameObject.SetActive(configVo.num != -1);

            if (configVo.num != -1)    //满了 -1
            {
                configVo = A3_RideModel.getInstance().GetValueByType <RideGiftConfigVo>(( int )giftVo.lvl + 1);

                BuildGo(configVo.attMaping[( int )type], _nextgolst, _parentNextGo);
            }
        }