I know this question has been answered before, but I'm trying to figure out why it isn't working in my specific case.
I have a public static string declared.
public static string currentUserEmail;
After the user creates an account, I store the Email address as currentUserEmail, but when debugging currentUserEmail is null.
FirebaseAuth.DefaultInstance.CreateUserWithEmailAndPasswordAsync(EmailAddress.text, Password.text).
ContinueWith(task =>
{
if (task.IsCanceled)
{
Debug.LogError("CreateUserWithEmailAndPaswordAsync was canceled.");
return;
}
if (task.IsFaulted)
{
Debug.LogError("CreateUserWithEmailAndPasswordAsync encountered an error: " + task.Exception);
return;
}
FirebaseUser newUser = task.Result;
currentUserEmail = newUser.Email;
Later I use another script to access the string with SCRIPTNAME.currentUserEmail, but in both situations it returns null. How can I access newUser.Email from another script?