Esempio n. 1
0
    public void ACTION_REGISTER()
    {
        ButtonHelper.Clicked();
        string name          = register.transform.Find("name").GetComponent <InputField>().text;
        string email         = register.transform.Find("email").GetComponent <InputField>().text;
        string password      = register.transform.Find("password").GetComponent <InputField>().text;
        string gamerID       = register.transform.Find("gamerID").GetComponent <InputField>().text;
        string validEmail    = FormValidation.ValidEmail(email);
        string validName     = FormValidation.ValidName(name);
        string validPassword = FormValidation.ValidPassword(password);
        string validGamerID  = FormValidation.ValidGamerID(gamerID);


        if (validName != null)
        {
            ErrorPanel.ShowError(validName);
            ButtonHelper.ResetClick();
        }

        else if (validGamerID != null)
        {
            ErrorPanel.ShowError(validGamerID);
            ButtonHelper.ResetClick();
        }

        else if (validEmail != null)
        {
            ErrorPanel.ShowError(validEmail);
            ButtonHelper.ResetClick();
        }

        else if (validPassword != null)
        {
            ErrorPanel.ShowError(validPassword);
            ButtonHelper.ResetClick();
        }

        else
        {
            OnlineManager.UserData.Name     = name;
            OnlineManager.UserData.EmailID  = email;
            OnlineManager.UserData.Password = password;
            OnlineManager.UserData.GamerID  = gamerID;
            StartCoroutine(onlineManager.Register());
        }
    }