Join Harrison Ferrone for an in-depth discussion in this video Demo: What you're building, part of Unity: Working with Google Firebase.
- [Instructor] The goal of this course is to come away with the solid foundational knowledge and hands-on experience with the Firebase SDK, specifically, its authentication and real time database features. I also want you to have a skeleton of a reusable data service that you can expand going forward with your own game projects. We'll start with an onboarding scene, where we have a user register a new account or log in to an existing one. In order to sign up a new user, you'll have to run the project in X code, so that we can access the Firebase authentication API, but you'll still be able to log in and test our other scene here in the Unity Editor.
Don't worry about this too much right now. We'll go through it step by step. If we run our game, can enter a valid email, and the password doesn't really matter at this point, so it can be nothing or you can enter whatever you'd like, as long as it's not run in X code, and just hit log in. You'll see that the game is loading, and then we're taken to our player board scene. This is where we'll have a view of all of our players from our database, and a brief snapshot of their information and our own player information.
Since the course is primarily focused on using the Firebase API, this starter project has the UI already set up for both scenes, and a few manager scripts to take care of the busy work that usually goes into setting up a system like this. Before we look at the starter project too closely, let's touch on how the code architecture is going to be set up. All of our authorization code will be handled by an auth manager. Likewise, all the database code will be handled by a database manager. Now this manager script is going to be a singleton, and it won't be destroyed from seeing the scene.
We'll have separate managers for our sign-up and log in form, and our player list scene. With our project structured like this, we can keep our Firebase codes sequestered away from our game and UI code, which is good practice and makes reusability much easier.
- Working with Firebase
- Adding signup and login functionality
- Building a player class
- Saving data
- Retrieving data
- Displaying data in the Unity GUI
- Making a reusable asset package for other Unity projects