Beispiel #1
0
        private void ClosePanel()
        {
            if (typeof(RegisterView) == this.GetType())
            {
                CloseViewInfo info = new CloseViewInfo(3);

                lv.egv.HideView(1, info);
            }
            else
            {
                CloseViewInfo info = new CloseViewInfo(4);

                lv.egv.HideView(0, info);
            }
            //选取模式2关闭
            ClearInput();
        }
Beispiel #2
0
        /// <summary>
        /// 注意此方法已经在_Proxy.AddNetListenner
        /// 于是在服务器发来对应消息后,本方法被调用1-2,1-4
        /// </summary>
        /// <param name="msg"></param>
        private void LoginCallback(MsgRec msg)
        {
            ResponeLogin p          = (ResponeLogin)msg._proto; //取出Proto对象(在注册了本消息的Proto解析器后,此项才可能存在
            LoginModel   loginModel = LoginModel.Instance;

            loginModel.Nickname = p.Username; //从Proto对象中取值

//            Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "接收", p.Username));

            loginModel.Uid              = p.Uid;
            loginModel.Head             = p.Head;
            loginModel.Lv               = p.Lv;
            loginModel.Exp              = p.Exp;
            loginModel.LevelMaxExp      = p.LevelMaxExp;
            loginModel.Oil1             = p.Oil;
            loginModel.DogLv            = p.DogLv;
            loginModel.ContinueDays     = p.ContinueDays;
            loginModel.Gold             = p.Gold;
            loginModel.DogUpgradeMaxExp = p.DogUpgradeMaxEXP;
            loginModel.DogCurrentExp    = p.DogCurrentEXP;
            loginModel.Chance           = p.Chance;
            loginModel.Code             = p.InvitationCode;
            loginModel.Account          = p.Account;
            FieldsModel.Instance.SetData(p.MapArrayList);
            SignModel.Instance.SetData(p.AwardInfosList);
            loginModel.IsPayForApp = p.IsPayForAPP == 1?true:false;
            if (FriendFarmManager.Instance.isVisiting)
            {
                FriendFarmManager.Instance.GoHome();
            }
            if (isfirstStart)
            {
                ViewMgr.Instance.Open(ViewNames.IntroduceView);
                isfirstStart = false;
            }

            CloseViewInfo info = new CloseViewInfo((int)hide1);

            GlobalDispatcher.Instance.Dispatch(LoginEvent.OnLoginSucc, info);
            GlobalDispatcher.Instance.Dispatch(GlobalEvent.onPlayerPanelReflash);
        }
Beispiel #3
0
        /// <summary>
        /// 注册成功调用事件
        /// </summary>
        /// <param name="eid"></param>
        /// <param name="args"></param>
        public virtual bool OnRegisterSucc(int eid, object args)
        {
            LoginModel.Instance.Account  = Input.text;
            LoginModel.Instance.Password = Password.text;
            if (!string.IsNullOrEmpty(LoginModel.Instance.Account))
            {
                PlayerSave.SetString("Account", LoginModel.Instance.Account);
            }
            if (!string.IsNullOrEmpty(LoginModel.Instance.Password))
            {
                PlayerSave.SetString("Password", LoginModel.Instance.Password);
            }
            ViewMgr.Instance.Open(ViewNames.SystemMsgView);
            SystemMsgView.SystemFunction(Function.Tip, Info.RegisterSucc, 2);
            //                LoginController.Instance.SendloginSDKReq(Input.text, Password.text, (int)Application.platform, "111114442");
            lv.egv.Set(Password.text, Input.text);
            CloseViewInfo info = new CloseViewInfo(3);

//            lv.egv.HideView(1, info);
            return(false);
        }
Beispiel #4
0
        public override bool OnRegisterSucc(int eid, object args)
        {
            LoginModel.Instance.Account  = Input.text;
            LoginModel.Instance.Password = Password.text;
            if (!string.IsNullOrEmpty(LoginModel.Instance.Account))
            {
                PlayerSave.SetString("Account", LoginModel.Instance.Account);
            }
            if (!string.IsNullOrEmpty(LoginModel.Instance.Password))
            {
                PlayerSave.SetString("Password", LoginModel.Instance.Password);
            }

            SystemMsgView.SystemFunction(Function.Tip, Info.RegisterSucc, 2);
            lv.egv.Set(Password.text, Input.text);
            CloseViewInfo info = new CloseViewInfo(4);

            lv.egv.HideView(1, info);

            return(false);
        }
Beispiel #5
0
        /// <summary>
        /// 隐藏面板动画
        ///
        /// </summary>
        public bool HideView(int id, object arg)
        {
            CloseViewInfo closeView = arg as CloseViewInfo;
            int           pattern   = closeView.pattern;

            //返回的时候保存密码
            if (PlayerSave.HasKey("Account") || PlayerSave.HasKey("Password"))
            {
                password.text     = PlayerSave.GetString("Password");
                inputAccount.text = PlayerSave.GetString("Account");
            }
            if (pattern == 0)
            {
                //直接登录动画
                EnterGameTweener.PlayBackwards();

                EnterGameTweener.onPause += () =>
                {
                    LoginEnterToMain();
                };
            }
            else if (pattern == 1)
            {
                //注册账号界面直接登录
                RegisterViewTweener.PlayBackwards();

                RegisterViewTweener.onPause += () =>
                {
                    LoginEnterToMain();
                };
            }
            else if (pattern == 2)
            {
                ChangePWViewTweener.PlayBackwards();

                ChangePWViewTweener.onPause += () =>
                {
                    LoginEnterToMain();
                };
            }
            else if (pattern == 3)
            {
                //注册账号界面直接登录
                RegisterViewTweener.PlayBackwards();

                RegisterViewTweener.onPause += () =>
                {
                    lv.EnterGameView.SetActive(true);
                    EnterGameTweener.PlayForward();
                    if (PlayerSave.HasKey("Account") && PlayerSave.HasKey("Password"))
                    {
                        password.text     = PlayerSave.GetString("Password");
                        inputAccount.text = PlayerSave.GetString("Account");
                    }
                };
            }
            else if (pattern == 4)
            {
                ChangePWViewTweener.PlayBackwards();

                ChangePWViewTweener.onPause += () =>
                {
                    lv.EnterGameView.SetActive(true);

                    EnterGameTweener.PlayForward();
                    if (PlayerSave.HasKey("Account") && PlayerSave.HasKey("Password"))
                    {
                        password.text     = PlayerSave.GetString("Password");
                        inputAccount.text = PlayerSave.GetString("Account");
                    }
                };
            }

            return(false);
        }