// Update is called once per frame
    void Update()
    {
        if (!loggingIn && !loggedIn && !Registering)
        {
            if (UserLoginText.GetComponent <TMP_InputField>().text != "" &&
                PasswordText.GetComponent <TMP_InputField>().text != "")
            {
                LoginButton.SetActive(true);
                LoginButtonCover.SetActive(false);
            }
            else
            {
                LoginButton.SetActive(false);
                LoginButtonCover.SetActive(true);
            }
        }

        if (Registering)
        {
            if (RegisterName.GetComponent <TMP_InputField>().text != "" &&
                RegisterPassword.GetComponent <TMP_InputField>().text != "" &&
                RegisterAge.GetComponent <TMP_InputField>().text != "" &&
                RegisterLocation.GetComponent <TMP_InputField>().text != "")
            {
                SubmitCoverButton.SetActive(false);
                SubmitButton.SetActive(true);
            }
            else
            {
                SubmitCoverButton.SetActive(true); SubmitButton.SetActive(false);
            }
        }


        if (loggingIn)
        {
            if (loginConfirmed)
            {
                fakeLoginCount++;
                if (fakeLoginCount > 180)
                {
                    LoggedIn();
                    loggingIn      = false;
                    fakeLoginCount = 0;
                }
            }
        }

        if (loginFailed)
        {
            errorCount++;
            if (errorCount > 250)
            {
                loginFailed = false;
                errorCount  = 0;
                ErrorMessageBacking.SetActive(false);
                ErrorMessageText.SetActive(false);
            }
        }
    }
 public void AccountCreated()
 {
     ErrorMessageBacking.SetActive(true);
     ErrorMessageText.SetActive(true);
     ErrorMessageText.GetComponent <TextMeshProUGUI>().text = "Registration Completed";
     ErrorMessageBacking.GetComponent <Image>().color       = cConfirm;
 }
 public void UserExists()
 {
     ErrorMessageBacking.SetActive(true);
     ErrorMessageText.SetActive(true);
     ErrorMessageText.GetComponent <TextMeshProUGUI>().text = "Account Already Exists";
     ErrorMessageBacking.GetComponent <Image>().color       = cError;
 }
 public void IncorrectLogin()
 {
     loggingIn = false;
     LoginButtonText.GetComponent <TextMeshProUGUI>().fontSize = 23.28f;
     LoginButtonText.GetComponent <TextMeshProUGUI>().text     = "Connect";
     ErrorMessageBacking.SetActive(true);
     ErrorMessageText.SetActive(true);
     ErrorMessageText.GetComponent <TextMeshProUGUI>().text = "Incorrect Login or Password";
     ErrorMessageBacking.GetComponent <Image>().color       = cError;
 }