From the course: Unity: Working with Google Firebase

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Retrieve player data

Retrieve player data

From the course: Unity: Working with Google Firebase

Start my 1-month free trial

Retrieve player data

- [Instructor] While I've still got X Code open, I'm going to create a few dummy users, so we have some data to work with. So there's a new player, I'm going to rerun this. I think 4 players should be enough, so I'm going to click out of X Code, and out of the simulator. And if you go back into your Fire Quest project, you should all your test users correctly added. Now we're going to add a player list variable into our player board manager, the idea being that when this script initializes, we'll fetch our entire list of players, and then assign to this variable. At the top of the script, let's have a public list of type player. I'm going to call this "player list," and I'm going to initialize it to a new list. I'm going to delete the Start and Update functions, because we're not going to use those, and I'm going to use the Void Awake method instead. So the first thing we need to do here is clear our player list on load. Otherwise when we pull new data, it's just going to append it to…

Contents