FirebaseManager fbManager; //ref to FirebaseManager Instance for easy access // Start is called before the first frame update void Start() { //Ref for our userID userID = FirebaseAuth.DefaultInstance.CurrentUser.UserId; //Create ref for our firebase Instance fbManager = FirebaseManager.Instance; //Tell the user what's happening Log("Loading data for: " + userID); //Load userInfo StartCoroutine(fbManager.LoadData("users/" + userID, LoadedUser)); }
private void CheckedActiveGame() { //Does our user doesn't have an active game? if (user.activeGame == "" || user.activeGame == null) { //Start the new game process Log("No active game for the user, look for a game"); StartCoroutine(fbManager.CheckForGame("games/", NewGameLoaded)); } else { //We already have a game, load it Log("Loading Game: " + user.activeGame); StartCoroutine(fbManager.LoadData("games/" + user.activeGame, GameLoaded)); } }