Мой зарегистрированный пользователь работает отлично, однако, когда я пытаюсь войти в систему, я не получаю никаких сообщений, успешного входа или неудачного входа. Я пытаюсь войти в систему, а затем перейти на экран входа в систему. Если кто-то сможет увидеть, что я делаю, я буду очень благодарен! Я предоставлю свой код ниже. Спасибо за вашу помощь!
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System;
using System.Text.RegularExpressions;
using UnityEngine.SceneManagement;
using Firebase;
using Firebase.Auth;
public class Login : MonoBehaviour {
public GameObject email;
public GameObject password;
private string Email;
private string Password;
Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
void Update () {
if (email.GetComponent<InputField>().isFocused){
password.GetComponent<InputField>().Select();
}
if (Password != ""&&Password != ""){
LoginButton();
}
Email = email.GetComponent<InputField>().text;
Password = password.GetComponent<InputField>().text;
}
public void LoginButton()
{
auth.SignInWithEmailAndPasswordAsync(Email, Password).ContinueWith(task => {
if (task.IsCanceled) {
Debug.LogError("SignInWithEmailAndPasswordAsync was canceled.");
return;
}
if (task.IsFaulted) {
Debug.LogError("SignInWithEmailAndPasswordAsync encountered an error: " + task.Exception);
return;
}
Firebase.Auth.FirebaseUser newUser = task.Result;
Debug.LogFormat("User signed in successfully: {0} ({1})",
newUser.DisplayName, newUser.UserId);
SceneManager.LoadScene("LoginScreen");
});
}
}