void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
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; }
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; } } }