将Firebase与Unity集成
问题描述:
我正尝试使用Unity和Firebase创建授权场景。我的C#脚本的屏幕截图以及显示的错误附在此处。是否需要为集成Firebase指定单独的目录?我浏览了此链接中提供的文档:https://firebase.google.com/docs/auth/unity/password-auth。 我已经完成了所有的步骤。请通过它,告诉我我错过了什么!将Firebase与Unity集成
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
using System.Collections.Generic;
public class SignUp : MonoBehaviour
{
\t public GameObject list;
\t public Text email;
\t public Text password;
\t public GameObject logIn;
\t Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
\t private string userID;
\t private string pass;
\t // Use this for initialization
\t void Start()
\t {
\t \t //Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
\t }
\t
\t // Update is called once per frame
\t void Update()
\t {
\t \t auth.CreateUserWithEmailAndPasswordAsync (userID, pass).ContinueWith (task => {
\t \t \t if (!task.IsCanceled && !task.IsFaulted)
\t \t \t \t Debug.Log ("User Created");
\t \t \t else
\t \t \t \t Debug.Log ("User Creation Failed");
\t \t });
\t }
\t public void signUp()
\t {
\t \t list.SetActive (true);
\t \t logIn.SetActive (false);
\t }
\t public void details()
\t {
\t \t userID = email.text.ToString();
\t \t pass = password.text.ToString();
\t \t print (userID);
\t \t print (pass);
\t }
}
你的屏幕截图在哪里?顺便说一下,不要张贴截图,请直接发布代码。 –
我已经做了@MichaelFaisst – Meenakshi
那么错误是什么? – UnholySheep