我正在尝试使用Unity和Firebase创建授权场景。我的C#脚本的屏幕截图以及显示的错误都附在此处。是否需要为Firebase集成指定单独的目录。我浏览了此链接中提供的文档:https://firebase.google.com/docs/auth/unity/password-auth。 我已经完成了所有步骤。请仔细阅读,告诉我我错过了什么!
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
using System.Collections.Generic;
public class SignUp : MonoBehaviour
{
public GameObject list;
public Text email;
public Text password;
public GameObject logIn;
Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
private string userID;
private string pass;
// Use this for initialization
void Start ()
{
//Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
}
// Update is called once per frame
void Update ()
{
auth.CreateUserWithEmailAndPasswordAsync (userID, pass).ContinueWith (task => {
if (!task.IsCanceled && !task.IsFaulted)
Debug.Log ("User Created");
else
Debug.Log ("User Creation Failed");
});
}
public void signUp ()
{
list.SetActive (true);
logIn.SetActive (false);
}
public void details ()
{
userID = email.text.ToString ();
pass = password.text.ToString ();
print (userID);
print (pass);
}
}

答案 0 :(得分:0)
我发现了什么问题。显然,Firebase Auth无法在Unity Editor中实现。 https://github.com/firebase/quickstart-unity/issues/3