//--------------------------------------------------------------------------------
        // onClickRegister
        //--------------------------------------------------------------------------------
        public void onClickRegister()
        {
            if (inputUsername != null &&
                inputEmail != null &&
                inputPassword != null)
            {
                if (LoomClient.validateName(inputUsername.text) &&
                    LoomClient.validateEmail(inputEmail.text) &&
                    LoomClient.validatePassword(inputPassword.text)
                    )
                {
                    string[] fields = new string[] { inputUsername.text, inputPassword.text, inputEmail.text, LoomClient.AppId };

                    TemporaryDisable(buttonRegister);

                    LoomClient.ActionRegisterAccount(fields, onCallbackRegister);
                }
                else
                {
                    FindObjectOfType <LC_UIPanelMessage>().Show(LoomClient.LANG_ERROR);
                }
            }
            else
            {
                Debug.LogWarning(LoomClient.LANG_EDITOR_MISSING + this.name);
            }
        }
        //--------------------------------------------------------------------------------
        // onClickChangePassword
        //--------------------------------------------------------------------------------
        public void onClickChangePassword()
        {
            if (inputPasswordOld != null &&
                inputPassword != null &&
                inputPasswordRepeat != null)
            {
                if (LoomClient.validatePassword(inputPasswordOld.text) &&
                    LoomClient.validatePassword(inputPassword.text) &&
                    LoomClient.validatePassword(inputPasswordRepeat.text) &&
                    inputPasswordOld.text != inputPassword.text
                    )
                {
                    string[] fields = new string[] { inputPasswordOld.text, inputPassword.text };

                    TemporaryDisable(buttonChange);

                    LoomClient.ActionChangeAccountPassword(fields, onCallbackChangePassword);
                }
                else
                {
                    FindObjectOfType <LC_UIPanelMessage>().Show(LoomClient.LANG_ERROR);
                }
            }
            else
            {
                Debug.LogWarning(LoomClient.LANG_EDITOR_MISSING + this.name);
            }
        }
Exemple #3
0
        //--------------------------------------------------------------------------------
        // onClickDeleteAccount
        //--------------------------------------------------------------------------------
        public void onClickDeleteAccount()
        {
            if (inputUsername != null &&
                inputPassword != null)
            {
                if (LoomClient.validateName(inputUsername.text) &&
                    LoomClient.validatePassword(inputPassword.text)
                    )
                {
                    string[] fields = new string[] { inputUsername.text, inputPassword.text };

                    TemporaryDisable(buttonDelete);

                    LoomClient.ActionDeleteAccount(fields, onCallbackDeleteAccount);
                }
            }
            else
            {
                Debug.LogWarning(LoomClient.LANG_EDITOR_MISSING + this.name);
            }
        }