public void update_and_refresh()
        {
            // Update results and scores
            // Get predictions from database
            database_caller dgp = new database_caller();

            //CommonData._loaded_predictions = false;
            //dgp.get_predictions_from_database();

            // Get fixtures and results
            CommonData._loaded_fixtures = false;
            dgp.get_fixtures_and_results_from_database();

            // Get scores from database
            CommonData._loaded_scores = false;
            dgp.get_scores_from_database();

            reload_asked = true;

            // Show loading screen if it is not being shown
            if (_loading_cover.activeInHierarchy == false)
            {
                _loading_cover.SetActive(true);
            }

            _loading_cover.SetActive(false);
        }
Beispiel #2
0
        public void Start()
        {
            auth = Firebase.Auth.FirebaseAuth.DefaultInstance;

            welcome_user();

            // If predictions resubmitted then need to update the database stored on device
            database_caller dgp = new database_caller();

            dgp.get_predictions_from_database();
        }
Beispiel #3
0
        void StartGame()
        {
            Firebase.AppOptions ops = new Firebase.AppOptions();
            CommonData.app = Firebase.FirebaseApp.Create(ops);
            auth           = Firebase.Auth.FirebaseAuth.DefaultInstance;
            var user = auth.CurrentUser;

#if UNITY_EDITOR
            CommonData.app.SetEditorDatabaseUrl("https://unityfirebasefootballpredictor.firebaseio.com/");
#endif

            //// 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_caller dgp = new database_caller();
            CommonData._loaded_predictions = false;
            dgp.get_predictions_from_database();

            // Get fixtures and results
            CommonData._loaded_fixtures = false;
            dgp.get_fixtures_and_results_from_database();

            // Get scores from database
            CommonData._loaded_scores = false;
            dgp.get_scores_from_database();

            // If user is signed in
            if (user != null)
            {
                Debug.Log("user is signed in");
                Welcome_Text.text          = "Welcome back " + user.DisplayName;
                CommonData.first_home_view = true;

                //scene_transition_manager.GetComponent<scene_manager>().load_home_scene();
            }
            // If user is not signed in
            else
            {
                Debug.Log("user is not signed in");
                scene_transition_manager.GetComponent <scene_manager>().load_no_user_scene();
            }
        }