예제 #1
0
        public void Login()
        {
            Debug.Log("Login");

            string ErrorMsg = "";

            if (!loginUserEmailValidator.IsValidCheck())
            {
                loginUserEmail.text = "";
                loginUserPassword.placeholder.GetComponent <Text>().color = Color.red;
                loginUserEmail.placeholder.GetComponent <Text>().text     = "Invalid Email";
                ErrorMsg = "Invalid Email";
            }

            if (!loginUserPasswordValidator.IsValidCheck())
            {
                if (!string.IsNullOrEmpty(ErrorMsg))
                {
                    ErrorMsg += "\n";
                }
                loginUserPassword.text = "";
                loginUserPassword.placeholder.GetComponent <Text>().color = Color.red;
                loginUserPassword.placeholder.GetComponent <Text>().text  = "Invalid Password";
                ErrorMsg = "Invalid Password";
            }

            if (string.IsNullOrEmpty(ErrorMsg))
            {
                Debug.Log("login email: " + loginUserEmail.text + " login password: "******"SocialPlay_Login_UserEmail", loginUserEmail.text);
                AccountServices.Login(new LoginRequest(loginUserEmail.text.ToLower(), loginUserPassword.text), OnReceivedCloudGoodsUser);
            }
        }
예제 #2
0
        public void Register()
        {
            string ErrorMsg = "";

            if (!registerUserEmailValidator.IsValidCheck())
            {
                registerUserEmail.text = "";
                registerUserEmail.placeholder.GetComponent <Text>().color = Color.red;
                registerUserEmail.placeholder.GetComponent <Text>().text  = "Invalid Email";
                ErrorMsg = "Invalid Email";
            }

            if (!registerUserPasswordValidator.IsValidCheck())
            {
                registerUserPassword.text = "";
                registerUserPassword.placeholder.GetComponent <Text>().color = Color.red;
                registerUserPassword.placeholder.GetComponent <Text>().text  = "Invalid Password";
                ErrorMsg = "Invalid password";
            }

            if (!registerUserPasswordConfirmValidator.IsValidCheck())
            {
                registerUserPasswordConfirm.text = "";
                registerUserPasswordConfirm.placeholder.GetComponent <Text>().color = Color.red;
                registerUserPasswordConfirm.placeholder.GetComponent <Text>().text  = "Invalid Password";
                ErrorMsg = "Invalid password";
            }

            if (string.IsNullOrEmpty(ErrorMsg))
            {
                AccountServices.Register(new RegisterUserRequest(registerUserName.text, registerUserEmail.text, registerUserPassword.text), OnRegisteredUser);
            }
        }