Example #1
0
 public void Init(UILoginComponent com)
 {
     this.com = com;
     com.OnLoginBtnButtonClick(() =>
     {
         LoginHelper.OnLoginAsync(this.com.Account_InputField.text).Coroutine();
     });
 }
Example #2
0
        public async void Awake()
        {
            // 获取配置文件
            {
                string fileName = "otherConfig-" + PlatformHelper.GetVersionName() + ".json";
                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/" + fileName, OtherConfig.getInstance().init);
            }

            ToastScript.clear();
            Instance = this;
            initData();
            CommonUtil.SetTextFont(panel_start.transform.parent.gameObject);
        }
            public override void Run(int errorStatus)
            {
                UI mUILogin = UIComponent.Instance.Get(UIType.UILogin);

                if (null != mUILogin && null != mUILogin.GameObject)
                {
                    UILoginComponent mUILoginComponent = mUILogin.UiBaseComponent as UILoginComponent;
                    if (null != mUILoginComponent)
                    {
                        if (mUILoginComponent.IsAutoLogin)
                        {
                            mUILoginComponent.UsingSprite();
                            mUILoginComponent.RC.gameObject.SetActive(true);
                            GameObject defaultObj = GameObject.Find("Global/UI/LobbyCanvas/UIDefault(Clone)");
                            if (null != defaultObj)
                            {
                                GameObject.Destroy(defaultObj);
                            }
                        }
                        else
                        {
                            UIComponent.Instance.ShowNoAnimation(UIType.UIDialog, new UIDialogComponent.DialogData()
                            {
                                type = UIDialogComponent.DialogData.DialogType.Commit,
                                // title = $"温馨提示",
                                title = CPErrorCode.LanguageDescription(10007),
                                // content = $"当前线路不稳定,已为您切换线路重新连接",
                                content = CPErrorCode.LanguageDescription(20071),
                                // contentCommit = "知道了",
                                contentCommit = CPErrorCode.LanguageDescription(10024),
                                contentCancel = "",
                                actionCommit  = null,
                                actionCancel  = null
                            });
                        }
                    }
                }
            }
Example #4
0
        private async Task RequestUpdateServer()
        {
            UINetLoadingComponent.showNetLoading();
            IPEndPoint manager = UILoginComponent.ToIPEndPointWithYuMing(10000);

            ETModel.Session managerSession = ETModel.Game.Scene.GetComponent <NetOuterComponent>().Create(manager);

            M2C_Reload g2cUpdateServer = (M2C_Reload)await managerSession.Call(new C2M_Reload()
            {
                AppType = AppType.Map
            });

            UINetLoadingComponent.closeNetLoading();

            if (g2cUpdateServer.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cUpdateServer.Message);

                return;
            }

            ToastScript.createToast("更新成功");
            managerSession.Dispose();
        }