简体   繁体   中英

Integrating Firebase with Unity

I am trying to create an Authorisation scene using Unity and Firebase. A screenshot of my C# script along with the error shown is attached here. Is there a separate directory that needs to be specified for integrating Firebase. I went through the documentation provided in this link: https://firebase.google.com/docs/auth/unity/password-auth . I have done all the steps. Please go through it, and tell me what I'm missing!

 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); } } 

I found out what was going wrong. Apparently, Firebase Auth cannot be implemented in Unity Editor. https://github.com/firebase/quickstart-unity/issues/3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM