コード例 #1
0
        private void SetRideData(GameObject go, RideConfigVo vo)
        {
            Image icon = go.transform.FindChild("Image/icon").GetComponent <Image>();

            var image_Lock = go.transform.FindChild("Image/Image_Lock").gameObject;

            icon.sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + vo.icon);

            BaseButton btn = new BaseButton(go.transform.FindChild("Image"));

            btn.onClick = ItemBtnHandle;

            _btnLst.Add(btn);

            icon.transform.parent.gameObject.name = vo.id.ToString();

            go.SetActive(true);

            go.transform.SetParent(_parentitemGo.transform);

            go.transform.localScale = new Vector3(1, 1, 1);

            var rideInfo = A3_RideModel.getInstance().GetRideInfo();

            var mapping = rideInfo.ridedressMapiping;

            image_Lock.SetActive(!mapping.ContainsKey((uint)vo.id));

            if (_goMapping != null)
            {
                _goMapping[vo.id] = go;
            }
        }
コード例 #2
0
        private void ItemBtnHandle(GameObject go)
        {
            if (currGo != null)
            {
                if (int.Parse(go.name) == int.Parse(currGo.name) || isLoading)
                {
                    return;
                }
            }

            isLoading = true;

            RideConfigVo vo = A3_RideModel.getInstance().GetValueByType <RideConfigVo>(int.Parse(go.name));

            BuildConditionItem(vo.conditionLst, _conditionGo);

            _textName.text = vo.name.ToString();

            currGo = go;

            if (ride_a3._instance != null)
            {
                ride_a3._instance.CreatRideAvatar(int.Parse(go.name));
            }

            SetBtnLockState(vo.id);
        }
コード例 #3
0
        //所有坐骑配置config
        private void GetAllRideConfig()
        {
            List <SXML> xml = XMLMgr.instance.GetSXMLList("ride.mount");

            foreach (SXML x in xml)
            {
                RideConfigVo infos = new RideConfigVo();
                infos.conditionLst = new List <ConditionVO>();

                infos.id     = x.getInt("id");
                infos.desc   = x.getString("desc");
                infos.name   = x.getString("name");
                infos.avatar = x.getString("avatar");
                infos.icon   = x.getString("icon");

                int condition = x.getInt("condition");

                infos.condition = condition;

                if (condition != -1)   // 多 (单) 条件
                {
                    foreach (var _x in x.GetNodeList("unlock"))
                    {
                        ConditionVO vo = new ConditionVO();
                        vo.type      = _x.getUint("type");
                        vo.lvl       = _x.getUint("lvl");
                        vo.need_item = _x.getUint("need_item");
                        vo.need_num  = _x.getUint("need_num");
                        infos.conditionLst.Add(vo);
                    }
                }
                else
                {
                    List <SXML> conditionLst = x.GetNodeList("unlock");
                    if (conditionLst.Count > 0)
                    {
                        ConditionVO vo = new ConditionVO();
                        SXML        _x = conditionLst[0];
                        vo.type      = _x.getUint("type");
                        vo.lvl       = _x.getUint("lvl");
                        vo.need_item = _x.getUint("need_item");
                        vo.need_num  = _x.getUint("need_num");
                        infos.conditionLst.Add(vo);
                    }
                }

                AddMapping(infos.id, rideMapping, infos);
            }

            GetAllTransformConfigVo();
        }
コード例 #4
0
        public void OnAddOnClick()
        {
            _btnLock.onClick = (go) => {
                int id = int.Parse(currGo.name);

                RideConfigVo vo = A3_RideModel.getInstance().GetValueByType <RideConfigVo>(id);

                int errCode = GetErrCode(vo.conditionLst);

                if (errCode < 0)
                {
                    Globle.err_output(errCode);

                    return;
                }

                if (vo.condition != -1)
                {
                    A3_RideProxy.getInstance().SendC2S((uint)id, 0);
                }
                else
                {
                    A3_RideProxy.getInstance().SendC2S(( uint )id, vo.conditionLst[0].type);
                }
            };

            _btnChange.onClick = (go) =>

            {
                A3_RideProxy.getInstance().SendC2S(5, "dress", ( uint )int.Parse(currGo.name));
            };

            new BaseButton(this.transform.FindChild("help_btn")).onClick = (GameObject go) => {
                helpcon.SetActive(true);
            };
            new BaseButton(helpcon.transform.FindChild("close")).onClick = (GameObject go) => {
                helpcon.SetActive(false);
            };
        }
コード例 #5
0
        //所有坐骑配置Transformconfig
        private void GetAllTransformConfigVo()
        {
            List <SXML> xml = XMLMgr.instance.GetSXMLList("ride.transform");

            foreach (SXML x in xml)
            {
                int id = x.getInt("id");

                ConfigVo rideConfigvo;

                if (rideMapping.TryGetValue(id, out rideConfigvo))
                {
                    RideConfigVo _vo = rideConfigvo as RideConfigVo;

                    if (_vo.transformMapping == null)
                    {
                        _vo.transformMapping = new Dictionary <int, TransformConfigVo>();
                    }

                    List <SXML> _xml = x.GetNodeList("career");

                    foreach (var _x in _xml)
                    {
                        TransformConfigVo vo = new TransformConfigVo();

                        vo.postionMapping      = new Dictionary <string, float>();
                        vo.rotationMapping     = new Dictionary <string, float>();
                        vo.scaleMapping        = new Dictionary <string, float>();
                        vo.yinziscaleMapping   = new Dictionary <string, float>();
                        vo.yinzipostionMapping = new Dictionary <string, float>();

                        vo.carrer = _x.getInt("id");

                        vo.baseoffest = _x.getFloat("baseoffest");

                        string pos    = _x.getString("postion");
                        var    posLst = GetConfigLst(pos);
                        vo.postionMapping.Add("x", posLst[0]);
                        vo.postionMapping.Add("y", posLst[1]);
                        vo.postionMapping.Add("z", posLst[2]);        //位置

                        string rotation = _x.getString("rotation");
                        var    rotaLst  = GetConfigLst(rotation);
                        vo.rotationMapping.Add("x", rotaLst[0]);
                        vo.rotationMapping.Add("y", rotaLst[1]);
                        vo.rotationMapping.Add("z", rotaLst[2]);      // 旋转

                        string scale    = _x.getString("scale");
                        var    scaleLst = GetConfigLst(scale);
                        vo.scaleMapping.Add("x", scaleLst[0]);
                        vo.scaleMapping.Add("y", scaleLst[1]);
                        vo.scaleMapping.Add("z", scaleLst[2]);      // scale

                        //影子

                        string yinzipos    = _x.getString("yinziposition");
                        var    yinziposLst = GetConfigLst(yinzipos);
                        vo.yinzipostionMapping.Add("x", yinziposLst[0]);
                        vo.yinzipostionMapping.Add("y", yinziposLst[1]);
                        vo.yinzipostionMapping.Add("z", yinziposLst[2]);        //位置

                        string yinzisca    = _x.getString("yinziscale");
                        var    yinziscaLst = GetConfigLst(yinzisca);
                        vo.yinziscaleMapping.Add("x", yinziscaLst[0]);
                        vo.yinziscaleMapping.Add("y", yinziscaLst[1]);
                        vo.yinziscaleMapping.Add("z", yinziscaLst[2]);        //位置

                        string runpos = _x.getString("runpostion");

                        if (runpos != "null")
                        {
                            vo.runpostionMapping = new Dictionary <string, float>();
                            var runposLst = GetConfigLst(runpos);
                            vo.runpostionMapping.Add("x", runposLst[0]);
                            vo.runpostionMapping.Add("y", runposLst[1]);
                            vo.runpostionMapping.Add("z", runposLst[2]);        //位置
                        }

                        _vo.transformMapping.Add(vo.carrer, vo);
                    }
                }
            }
        }