Example #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Example #2
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
        }

        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://hanabi-86ab5.firebaseio.com/");
        reference = FirebaseDatabase.DefaultInstance.RootReference;
    }
Example #3
0
 private void CheckForFirebaseState()
 {
     if (!firebaseUsed && this.gameObject.GetComponent <FirebaseData>())
     {
         FirebaseData firebase = this.gameObject.GetComponent <FirebaseData>();
         if (firebase.DataRetrieved())
         {
             currState    = firebase.GetStartState();
             firebaseUsed = true;
             victoryState.SetANextState(currState, 0);
             failState.SetANextState(currState, 0);
         }
         roomTitle.text = currState.GetRoomTitle();
         SetupText();
         if (firebaseUsed)
         {
             firstMove = false;
         }
     }
 }