private void initFirebase() { Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance; app.SetEditorDatabaseUrl("https://lazzybee3d-99751721.firebaseio.com/"); mReference = FirebaseDatabase.DefaultInstance.RootReference; mDatabase = FirebaseDatabase.DefaultInstance; mAuth = Firebase.Auth.FirebaseAuth.DefaultInstance; }
//in order for a player to connect to the database, make sure this step happens first to set up the database instance public void CheckForDependencies() { FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { var dependencyStatus = task.Result; //Checks to make sure Database is ready to go if (dependencyStatus == DependencyStatus.Available) { //Setting up the Default Instance for the Database app = FirebaseApp.DefaultInstance; app.SetEditorDatabaseUrl("https://monster-defender.firebaseio.com/"); FirebaseAnalytics.SetAnalyticsCollectionEnabled(true); Test(); } else { Debug.LogError(string.Format( "Could not resolve all Firebase dependencies: {0}", dependencyStatus)); // Firebase Unity SDK is not safe to use here. } }); }