public override void Reload() { base.Reload(); WebServiceController.Instance.OnWebServiceResponse += OnWebServiceResponse; MAccountInfo account = Database.Instance.Account(); // Info Left txtNameUser.text = account.DisplayName; txtDateJoinGame.text = account.Time; // Info Right SetGold(account.Gold); SetCoin(account.Coin); txtNameAcount.text = account.Username.Substring(0, account.Username.Length - 4) + "xxxx"; txtIdAcount.text = account.AccountID.ToString(); string phoneNumber = ""; switch (Database.Instance.Account().State) { case -1: phoneNumber = "Đăng ký lại"; break; case 0: phoneNumber = "Chưa đăng ký"; break; case 1: phoneNumber = account.GetTel(); break; case 2: phoneNumber = "Chờ xác nhận"; break; } txtPhoneNumber.text = phoneNumber; if (!Database.Instance.Account().IsRegisterPhone()) { txtActiveSecurityLogin.text = ""; txtBtActiveSecurity.text = "Tắt"; imgBt.sprite = listSpriteBtSecurity[1]; } else if (Database.Instance.Account().IsOTP) { txtActiveSecurityLogin.text = "Đã đăng kí"; txtBtActiveSecurity.text = "Tắt"; imgBt.sprite = listSpriteBtSecurity[1]; } else { txtActiveSecurityLogin.text = "Chưa đăng kí"; txtBtActiveSecurity.text = "Bật"; imgBt.sprite = listSpriteBtSecurity[0]; } SetAvatar(Database.Instance.Account().AvatarID); }
public override void Reload() { base.Reload(); WebServiceController.Instance.OnWebServiceResponse += OnWebServiceResponse; inputFieldPhoneNew.text = ""; inputFieldOTPPhoneNew.text = ""; txtPhoneOld.text = ""; MAccountInfo accountInfo = Database.Instance.Account(); switch (accountInfo.State) { case 0: { objPhoneUpdateFisrt.SetActive(true); objPhoneUpdated.SetActive(false); objWaitActive.SetActive(false); objWaitReactive.SetActive(false); break; } case 1: { objPhoneUpdated.SetActive(true); objPhoneUpdateFisrt.SetActive(false); objWaitActive.SetActive(false); objWaitReactive.SetActive(false); txtPhoneOld.text = accountInfo.GetTel(); break; } case -1: { objWaitReactive.SetActive(true); objPhoneUpdated.SetActive(false); objPhoneUpdateFisrt.SetActive(false); objWaitActive.SetActive(false); phoneNumberRA.text = accountInfo.GetTel(); break; } case 2: { objWaitActive.SetActive(true); objPhoneUpdated.SetActive(false); objPhoneUpdateFisrt.SetActive(false); objWaitReactive.SetActive(false); phoneNumber.text = accountInfo.GetTel(); break; } } isRequestActiveSecurity = accountInfo.IsOTP; ChangeSecuritySucceed(); objPanelOTPSecurity.SetActive(false); }