|
|
@@ -1,6 +1,7 @@
|
|
|
using System;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
+using Firebase;
|
|
|
using UnityEngine;
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
@@ -32,8 +33,25 @@ public class GameManagerScript : MonoBehaviour {
|
|
|
[SerializeField] float movementSpeed = 1.0f;
|
|
|
|
|
|
List<KeyValuePair<string, int>> players;
|
|
|
+ private FirebaseApp app;
|
|
|
+
|
|
|
// Start is called before the first frame update
|
|
|
void Start() {
|
|
|
+ Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
|
|
|
+ var dependencyStatus = task.Result;
|
|
|
+ if (dependencyStatus == Firebase.DependencyStatus.Available) {
|
|
|
+ // Create and hold a reference to your FirebaseApp,
|
|
|
+ // where app is a Firebase.FirebaseApp property of your application class.
|
|
|
+ app = Firebase.FirebaseApp.DefaultInstance;
|
|
|
+
|
|
|
+ // Set a flag here to indicate whether Firebase is ready to use by your app.
|
|
|
+ } else {
|
|
|
+ UnityEngine.Debug.LogError(System.String.Format(
|
|
|
+ "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
|
|
|
+ // Firebase Unity SDK is not safe to use here.
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
GameId = PlayerPrefs.GetInt("GameId");
|
|
|
GameMode = PlayerPrefs.GetString("GameMode");
|
|
|
QuestionTimer = PlayerPrefs.GetInt("QuestionTimer");
|
|
|
@@ -108,6 +126,15 @@ public class GameManagerScript : MonoBehaviour {
|
|
|
|
|
|
NewQuestionCard.GetComponent<NewQuestionCardController>().GenerateNewQuestion();
|
|
|
// Destroy(NewQuestionCard.gameObject);
|
|
|
+ StopTimer();
|
|
|
+ }
|
|
|
+
|
|
|
+ internal void RemoveUnlockedQuestions()
|
|
|
+ {
|
|
|
+ if (scrollViewScript == null) {
|
|
|
+ scrollViewScript = GameObject.FindGameObjectWithTag("AnswerLine").transform.parent.parent.GetComponent<ScrollViewScript>();
|
|
|
+ }
|
|
|
+ scrollViewScript.RemoveUnlockedQuestions();
|
|
|
}
|
|
|
|
|
|
private void CreateLeftSpacer()
|