void Register()
    {
        if (emailText.text.Length == 0 || passwordText.text.Length == 0 || passwordText2.text.Length == 0 || nameText.text.Length == 0)
        {
            Debug.Log("Form incomplete. Please fill out all the fields.");
            toastPanel.OpenPopup("Form incomplete. Please fill out all the fields.");
            return;
        }

        if (passwordText.text.Length < 8)
        {
            Debug.Log("Password must be at least 8 characters.");
            toastPanel.OpenPopup("Password must be at least 8 characters.");
            return;
        }

        if (passwordText.text != passwordText2.text)
        {
            Debug.Log("Password doesn't match. Please try again.");
            toastPanel.OpenPopup("Password doesn't match. Please try again.");
            return;
        }
        for (int i = 0; i < emailText.text.Length; i++)
        {
            Debug.Log(emailText.text[i]);
        }
        Debug.Log("Register: " + emailText.text + ":" + passwordText.text + ":" + passwordText2.text);
        nakama.Register(nameText.text, emailText.text, passwordText.text, PlayerGender.MALE);
    }
    public void Register()
    {
        if (_inputFieldEmail.text.Length == 0 || _inputFieldPassword.text.Length == 0 || _inputFieldPassword2.text.Length == 0 || _inputFieldName.text.Length == 0)
        {
            DebugInfo.SetToast("Error", "Form incomplete. Please fill out all the fields.");
            debugPopupOpener.OpenPopup();
            return;
        }

        if (_inputFieldPassword.text.Length < 8)
        {
            DebugInfo.SetToast("Error", "Password must be at least 8 characters.");
            debugPopupOpener.OpenPopup();
            return;
        }

        if (_inputFieldPassword.text != _inputFieldPassword2.text)
        {
            DebugInfo.SetToast("Error", "Password doesn't match. Please try again.");
            debugPopupOpener.OpenPopup();
            return;
        }

        nakama.Register(_inputFieldName.text, _inputFieldEmail.text, _inputFieldPassword.text, gender);
    }