示例#1
0
 public void UpdataExtractNumByCoin()
 {
     ExtractRate.TrySetComponentValue(string.Format(RateFormat, YxUtiles.ReduceNumber(_curCostData.Rate)));
     if (ShowLabel)
     {
         string num = "";
         if (CostNumber)
         {
             num = CostNumber.value;
         }
         if (string.IsNullOrEmpty(num))
         {
             ShowLabel.text = "";
             return;
         }
         double getValue;
         if (double.TryParse(num, out getValue))
         {
             var coin = YxUtiles.GetShowNumber(UserInfoModel.Instance.UserInfo.CoinA);
             if (getValue > coin)
             {
                 getValue         = coin;
                 CostNumber.value = getValue.ToString();
             }
             _extractValue  = (double)YxUtiles.RecoverShowNumber(getValue) / _curCostData.Rate;
             ShowLabel.text = string.Format(ExtractFormat, GlobalUtile.ReduceNumber(_extractValue));
         }
     }
 }
示例#2
0
 /// <summary>
 /// 减速
 /// </summary>
 /// <returns></returns>
 private void SpeedDown()
 {
     _lastSpeed = ChangeAngular(-AngleAccelerated, _lastSpeed, Dial);
     if (GlobalUtile.IsSameSign(_lastSpeed, MaxAngleSpeed))
     {
         return;
     }
     _lastSpeed = 0;
     _curState  = State.Stop;
 }
示例#3
0
        protected void OnGUI()
        {
            if (string.IsNullOrEmpty(CurGameKey))
            {
                return;
            }
            GlobalUtile.ResizeGUIMatrix();
            var sh        = Screen.height;
            var fontStyle = new GUIStyle
            {
                normal =
                {
                    //                            background = null,
                    textColor = Color.white
                }

                //                    fontSize = rowH
            };
            const int gx = 30;

            GUILayout.BeginHorizontal();
            GUI.Label(new Rect(gx, 10, 120, 20), "请输入房间id", fontStyle);
            _editor_roomId = GUI.TextField(new Rect(gx + 130, 10, 100, 20), _editor_roomId);
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUI.Button(new Rect(gx, 95, 40, 20), "确 定"))
            {
                int rId;
                int.TryParse(_editor_roomId, out rId);
                if (rId > 0)
                {
                    var roomUm = RoomListModel.Instance.RoomUnitModel;
                    for (var i = 0; i <= rId; i++)
                    {
                        var rm = new RoomUnitModel(null)
                        {
                            TypeId  = _editor_roomId,
                            GameKey = CurGameKey
                        };
                        roomUm.Add(rm);
                    }
                }
                RoomListController.Instance.QuickGame(CurGameKey);
                CurGameKey = "";
            }
            if (GUI.Button(new Rect(gx + 90, 95, 40, 20), "取 消"))
            {
                CurGameKey = "";
            }
            GUILayout.EndHorizontal();
        }
示例#4
0
        /// <summary>
        /// 打开客服
        /// </summary>
        public void OnCustomServiceInfo()
        {
            var service = LoginInfo.Instance.G_MobileHallServerText;

            if (!string.IsNullOrEmpty(service))
            {
                if (GlobalUtile.IsUrl(service))
                {
                    Application.OpenURL(service);
                    return;
                }
                PanelCustom.SetActive(!PanelCustom.activeSelf);
                return;
            }
            YxWindowManager.OpenWindow("CustomerServiceWindow");
        }
示例#5
0
        public void UpAnchor()
        {
            var widget = GetComponent <UIWidget>();

            if (widget == null)
            {
                return;
            }
            var p = GlobalUtile.GetParentWidget <UIWidget>(widget.transform);

            if (p == null)
            {
                return;
            }
            widget.SetAnchor(p.gameObject, 0, 0, 0, 0);
            widget.updateAnchors = UIRect.AnchorUpdate.OnEnable;
        }
示例#6
0
        protected override void OnItemFresh()
        {
            var itemData = Data as ExtractRecordItemData;

            Platform.TrySetComponentValue(itemData.PlatformName);
            CostNumber.TrySetComponentValue(itemData.ExtractValue, "1", CostFormat);
            ExtractRate.TrySetComponentValue(string.Format(RateFormat, YxUtiles.ReduceNumber(itemData.PlatformRate)));
            GetNumber.TrySetComponentValue(string.Format(GetFormat, GlobalUtile.ReduceNumber(itemData.GetValue)));
            Time.TrySetComponentValue(itemData.ExtractTime);
            FailText.TrySetComponentValue(itemData.FailDesc);
            var count  = StatusObjs.Length;
            var status = itemData.Status;

            for (int i = 0; i < count; i++)
            {
                StatusObjs[i].TrySetComponentValue(i == status);
            }
        }
示例#7
0
        private void OnGUI()
        {
            if (SysCfg == null)
            {
                return;
            }
            GlobalUtile.ResizeGUIMatrix();
            var sh        = Screen.height;
            var fontStyle = new GUIStyle
            {
                normal =
                {
                    textColor = Color.white
                }
            };

            GUILayout.BeginHorizontal();

            if (GUI.Button(new Rect(-5, 0, 15, sh), ""))
            {
                _isShow = !_isShow;
            }
            GUILayout.EndHorizontal();
            if (!_isShow)
            {
                return;
            }
            GUI.Box(new Rect(-5, 0, Screen.width, sh), "");
            switch (_showUIType)
            {
            case GameLoginState.Login:     //登陆
                OnDrawLoginUI(fontStyle);
                break;

            case GameLoginState.Create:     //创建房间
                OnDrawCreateUI(fontStyle);
                break;

            case GameLoginState.Register:     //注册
                OnDrawRegister(fontStyle);
                break;
            }
        }
示例#8
0
        public void OnClickExtractView()
        {
            string platform = "";
            double value    = 0;
            string password = "";

            if (PlatformId)
            {
                platform = PlatformId.value;
            }
            else
            {
                platform = _curCostData.BindInfo.BindAccount;
            }
            if (CostNumber)
            {
                double.TryParse(CostNumber.value, out value);
            }
            else
            {
                return;
            }
            if (Password)
            {
                password = Password.value;
            }
            if (string.IsNullOrEmpty(platform))
            {
                YxMessageBox.Show(PlatformTip);
                return;
            }
            if (Password && string.IsNullOrEmpty(password))
            {
                YxMessageBox.Show("密码不能为空");
                return;
            }

            long realValue = YxUtiles.RecoverShowNumber(value);

            if (realValue < 1)
            {
                YxMessageBox.Show("请输入正确的兑换金额!!!");
                return;
            }
            var flag      = TelephoneVerify != null;
            var telVerify = flag ? TelephoneVerify.value : null;

            if ("".Equals(telVerify))
            {
                YxMessageBox.Show("请输入验证码!!!");
                return;
            }
            YxDebug.Log("Real value is:" + realValue);
            YxDebug.Log("show value is :" + value);
            var returnValue = YxUtiles.RecoverShowNumber(value);

            YxDebug.Log("Real exchange value is :" + returnValue);
            YxMessageBox.Show(
                string.Format(SureNoticeFormat, _curCostType, value, GlobalUtile.ReduceNumber(_extractValue)),
                null,
                (window, btnname) =>
            {
                switch (btnname)
                {
                case YxMessageBox.BtnLeft:
                    var dict = new Dictionary <string, object>()
                    {
                        { KeyExtractPlatformType, _curCostData.PlatformType },
                        { KeyExtractCostType, _curCostData.CostType },
                        { KeyExtractAccount, platform },
                        { KeyExtractValue, returnValue },
                        { KeyPassword, password },
                        { KeyTelephoneVerify, telVerify }
                    };
                    if (TheInputGroup != null)
                    {
                        TheInputGroup.Imbark(dict);
                    }
                    Facade.Instance <TwManager>().SendAction(ExtractAciton, dict,
                                                             delegate
                    {
                        if (gameObject.activeInHierarchy)
                        {
                            StartCoroutine(OnExtractSuccess.WaitExcuteCalls());
                        }
                        Clear();
                    }
                                                             );
                    break;

                case YxMessageBox.BtnRight:
                    break;
                }
            },
                true,
                YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                );
        }
示例#9
0
        protected void OnGUI()
        {
            GlobalUtile.ResizeGUIMatrix();
            var sh        = Screen.height;
            var fontStyle = new GUIStyle
            {
                normal =
                {
//                            background = null,
                    textColor = Color.white
                }

//                    fontSize = rowH
            };

            GUILayout.BeginHorizontal();
            if (GUI.Button(new Rect(0, 10, 10, sh), ""))
            {
                _isShow = !_isShow;
            }
            GUILayout.EndHorizontal();

            if (!_isShow)
            {
                return;
            }
            const int gx = 30;

            GUILayout.BeginHorizontal();
            GUI.Label(new Rect(gx, 10, 40, 20), "IP", fontStyle);
            var oldIp = GUI.TextField(new Rect(gx + 55, 10, 100, 20), PlayerPrefs.GetString("login_editor_ip"));

            PlayerPrefs.SetString("login_editor_ip", oldIp);
            var isUse = PlayerPrefs.GetInt("login_editor_use") == 1;

            isUse = GUI.Toggle(new Rect(gx + 170, 10, 25, 25), isUse, "");
            PlayerPrefs.SetInt("login_editor_use", isUse ? 1 : 0);
            if (isUse)
            {
                App.DevGameServer = oldIp;
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUI.Label(new Rect(gx, 35, 40, 20), "用户名", fontStyle);
            var newName = GUI.TextField(new Rect(gx + 55, 35, 100, 20), PlayerPrefs.GetString("login_editor_userName"));

            PlayerPrefs.SetString("login_editor_userName", newName);
            UserName.value = newName;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUI.Label(new Rect(gx, 60, 40, 20), "密  码", fontStyle);
            var pwd = GUI.TextField(new Rect(gx + 55, 60, 100, 20), PlayerPrefs.GetString("login_editor_userPwd"));

            PlayerPrefs.SetString("login_editor_userPwd", pwd);
            UserPwd.value = pwd;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUI.Button(new Rect(gx, 95, 40, 20), "登 录"))
            {
                OnLogin();
            }
            if (GUI.Button(new Rect(gx + 90, 95, 40, 20), "游 客"))
            {
                OnVisitor();
            }
            GUILayout.EndHorizontal();
        }