Ejemplo n.º 1
0
        public void ChangeRideDressS2cData(Variant s2cData)
        {
            rideInfo.dress = s2cData.getValue("dress")._uint;

            if (s2cData.ContainsKey("lock_dress"))
            {
                var lockdress = s2cData.getValue("lock_dress")._uint;

                rideInfo.ridedressMapiping.Remove(lockdress);  // 限时坐骑 移除

                Globle.err_output(-5704);
            }

            rideInfo.configVo = GetValueByType <RideConfigVo>((int)rideInfo.dress);

            if (SelfRole._inst != null && rideInfo.mount == ( uint )RIDESTATE.UP && A3_RideProxy.IsCanChangeRide(SelfRole._inst.dianjiTime))
            {
                if (SelfRole._inst.invisible)
                {
                    return; //隐身状态
                }

                SelfRole._inst.set_Ride(( int )rideInfo.dress, true);
            }
        }
Ejemplo n.º 2
0
        public void OnAddOnClick()
        {
            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);
            };

            _btn.onClick = (go) =>
            {
                if (_btn.interactable == false)
                {
                    return;
                }

                if (needNum > haveNum)
                {
                    Globle.err_output(-1104);
                    ArrayList data = new ArrayList();
                    data.Add(a3_BagModel.getInstance().getItemDataById(A3_RideModel.getInstance().GetUpGradeGiftItemId()));
                    data.Add(InterfaceMgr.RIDE_A3);
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data);
                    return;
                }
                _btn.interactable = false;

                A3_RideProxy.getInstance().SendC2S(3, "type", (uint)defaulSelect + 1);
            };
        }
Ejemplo n.º 3
0
 private void OnBtnFeedHandle(GameObject go)
 {
     if (haveNum >= num && isAutoState == false)
     {
         A3_RideProxy.getInstance().SendC2S(2, "num", 1);
     }
     else
     {
         Globle.err_output(-1104);
         ArrayList data1 = new ArrayList();
         data1.Add(a3_BagModel.getInstance().getItemDataById(A3_RideModel.getInstance().GetUpGradeRideItemId()));
         data1.Add(InterfaceMgr.RIDE_A3);
         InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1);
     }
 }
Ejemplo n.º 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);
            };
        }
Ejemplo n.º 5
0
        private void OnBtnAutoFeedHandle(GameObject go)
        {
            if (haveNum > 0 && isAutoState == false)
            {
                isAutoState = true;

                var rideModel = A3_RideModel.getInstance();

                float maxCount = ((float)rideModel.maxExp - ( float )rideModel.GetRideInfo().exp) / (float)A3_RideModel.getInstance().eachExp;

                uint s2cCount = (uint)Math.Ceiling(maxCount);

                A3_RideProxy.getInstance().SendC2S(2, "num", s2cCount > (uint)haveNum ? ( uint )haveNum : s2cCount);
            }
            else
            {
                Globle.err_output(-1104);
                ArrayList data1 = new ArrayList();
                data1.Add(a3_BagModel.getInstance().getItemDataById(A3_RideModel.getInstance().GetUpGradeRideItemId()));
                data1.Add(InterfaceMgr.RIDE_A3);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1);
            }
        }
Ejemplo n.º 6
0
 public void OnRemoveEventListener()
 {
     A3_RideProxy.getInstance().removeEventListener(( int )S2Cenum.RIDE_UPGRADE, OnUpdateData);
 }
Ejemplo n.º 7
0
 public void OnAddEventListener()
 {
     A3_RideProxy.getInstance().addEventListener(( int )S2Cenum.RIDE_UPGRADEGIFT, OnUpdateGiftData);
 }
Ejemplo n.º 8
0
 public void OnRemoveEventListener()
 {
     A3_RideProxy.getInstance().removeEventListener(( int )S2Cenum.RIDE_ADD, OnUpdateData);
     A3_RideProxy.getInstance().removeEventListener(( int )S2Cenum.RIDE_CHANGE, OnUpDressState);
     A3_RideProxy.getInstance().removeEventListener(( int )S2Cenum.RIDE_LIMIT, OnUpdateLimit);
 }