Exemple #1
0
 // Use this for initialization
 void Start()
 {
     //Firebase.Leaderboard.FirebaseInitializer.Initialize(dependencyStatus => {
     //    if (dependencyStatus == DependencyStatus.Available)
     //    {
     //        Debug.Log("Firebase database ready.");
     //        AnonSignIn();
     //        readyToInitialize = true;
     //    }
     //    else
     //    {
     //        Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
     //    }
     //});
     FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
         dependencyStatus = task.Result;
         if (dependencyStatus == DependencyStatus.Available)
         {
             Debug.Log("Dependency Status Available");
         }
         else
         {
             Debug.LogError(
                 "Could not resolve all Firebase dependencies: " + dependencyStatus);
         }
     });
 }
Exemple #2
0
        // When the app starts, check to make sure that we have
        // the required dependencies to use Firebase, and if not,
        // add them if possible.
        public virtual void Start()
        {
            Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = task.Result;
                if (dependencyStatus == Firebase.DependencyStatus.Available)
                {
                    InitializeFirebase();
                }
                else
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });

#if UNITY_EDITOR
            //Firebase.AppOptions ops = new Firebase.AppOptions();
            //CommonData.app = Firebase.FirebaseApp.Create(ops);
            //CommonData.app.SetEditorDatabaseUrl("https://unityfirebasefootballpredictor.firebaseio.com/");

            //// Get fixtures and results from database
            //database_get_fixtures dgf = new database_get_fixtures();
            //dgf.get_fixtures_and_results_from_database();

            //// Get predictions from database
            //database_get_predictions dgp = new database_get_predictions();
            //dgp.get_predictions_from_database();

            StartGame(); // FOR DESKTOP
#endif
        }
Exemple #3
0
        void InitializeFirebaseAndStart()
        {
            //Check firebase dependencies and start game
            Firebase.DependencyStatus dependencyStatus = Firebase.FirebaseApp.CheckDependencies();

            if (dependencyStatus != Firebase.DependencyStatus.Available)
            {
                Firebase.FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
                {
                    dependencyStatus = Firebase.FirebaseApp.CheckDependencies();
                    if (dependencyStatus == Firebase.DependencyStatus.Available)
                    {
                        StartGame();
                    }
                    else
                    {
                        Debug.LogError(
                            "Could not resolve all Firebase dependencies: " + dependencyStatus);
                        Application.Quit();
                    }
                });
            }
            else
            {
                StartGame();
            }
        }
    public void CheckIfReady()
    {
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            Firebase.DependencyStatus dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance;
                firebaseReady            = true;

                Debug.Log("Firebase is ready for use.");

                // Create and hold a reference to your FirebaseApp, i.e.
                //   app = Firebase.FirebaseApp.DefaultInstance;
                // where app is a Firebase.FirebaseApp property of your application class.

                // Set a flag here indicating that Firebase is ready to use by your
                // application.
            }
            else
            {
                firebaseReady = false;
                UnityEngine.Debug.LogError(System.String.Format(
                                               "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
                // Firebase Unity SDK is not safe to use here.
            }
        });
    }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        //Set the main menu panel to acctive upon starting the game
        MainPanel.SetActive(true);
        LoginPanel.SetActive(false);
        RegisterPanel.SetActive(false);
        SharedFieldsPanel.SetActive(false);
        AttemptingLoginPanel.SetActive(false);
        loginFin = false;
        AttemptingRegPanel.SetActive(false);
        regFin = false;

        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://finalprojectunity-31171.firebaseio.com/");
        reference  = FirebaseDatabase.DefaultInstance.RootReference;
        accountRef = reference.Child("users");
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });
    }
Exemple #6
0
    private async void Start()
    {
        Firebase.DependencyStatus dependencyStatus = await FirebaseApp.CheckAndFixDependenciesAsync();

        if (dependencyStatus == DependencyStatus.Available)
        {
            OnFirebaseInitialized.Invoke();
        }
    }
Exemple #7
0
 public virtual void Start()
 {
     Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
         dependencyStatus = task.Result;
         if (dependencyStatus == Firebase.DependencyStatus.Available)
         {
             InitializeFirebase();
         }
         else
         {
         }
     });
 }
 // When the app starts, check to make sure that we have
 // the required dependencies to use Firebase, and if not,
 // add them if possible.
 public void Start()
 {
     Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
         dependencyStatus = task.Result;
         if (dependencyStatus == Firebase.DependencyStatus.Available)
         {
             InitializeFirebase();
         }
         else
         {
             Debug.LogError(
                 "Could not resolve all Firebase dependencies: " + dependencyStatus);
         }
     });
 }
Exemple #9
0
    void Start()
    {
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
        {
            dependencyStatus = task.Result;

            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                authManager.InitializeFirebase();
            }
            else
            {
                Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}");
            }
        });
    }
 // When the app starts, check to make sure that we have
 // the required dependencies to use Firebase, and if not,
 // add them if possible.
 public virtual void Start()
 {
     Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
     {
         dependencyStatus = task.Result;
         if (dependencyStatus == Firebase.DependencyStatus.Available)
         {
             InitializeFirebase();
         }
         else
         {
             Debug.LogError(
                 "No esposible conectar con las dependencias de Firebase: " + dependencyStatus);
         }
     });
 }
    // use for initialization
    void Awake()
    {
        if (!GameManagerScript.debug)
        {
            settingsButton.SetActive(false);
        }
        else
        {
            settingsButton.SetActive(true);
        }

        // Set screen orientation mode to portrait only
        Screen.orientation = ScreenOrientation.Portrait;

        // set input method based on if touch input is supported or not
        if (Input.touchSupported)
        {
            //Debug.Log("Touch supported!");
            TouchInputHandler.touchSupported = true;
        }
        else
        {
            //Debug.Log("Touch not supported!");
            TouchInputHandler.touchSupported = false;
        }

        // Firebase database logistics for editor
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://wordflood-bf7c4.firebaseio.com/");

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            Firebase.DependencyStatus dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + dependencyStatus);
                GameManagerScript.logging = false;
            }
        });
    }
    // Use this for initialization
    void Start()
    {
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });

        parametricModel = GameObject.Find("Cube");
        //parametricModel.AddComponent<MeshFilter>();
    }
Exemple #13
0
    public async System.Threading.Tasks.Task InitializeFirebase()
    {
        Initialized = false;
        Firebase.DependencyStatus dependencyStatus = await Firebase.FirebaseApp.CheckAndFixDependenciesAsync();

        if (dependencyStatus == Firebase.DependencyStatus.Available)
        {
            Debug.Log("InitializeFirebase: Available!");
            // Set a flag here indiciating that Firebase is ready to use by your
            // application.
            LateInitialize();
            Initialized = true;
        }
        else
        {
            UnityEngine.Debug.LogError(System.String.Format("Could not resolve all Firebase dependencies: {0}", dependencyStatus));
            // Firebase Unity SDK is not safe to use here.
        }
    }
    void Awake()
    {
        //Using Firebase SDK
        //This is needed only for the unity editor
        FirebaseApp.DefaultInstance.SetEditorP12FileName("sweetseeds-abf2e299118d.p12");
        FirebaseApp.DefaultInstance.SetEditorServiceAccountEmail("*****@*****.**");
        FirebaseApp.DefaultInstance.SetEditorP12Password("notasecret");
        //--------------------------------------

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });
    }