Logging in to our game via Facebook
One of the things we can do using the Facebook API is allow our users to log in to the game using their Facebook account. Then, we can use their name and image automatically within our project:
- Let's first open up our Main Menu level by going to the
Project
window and open theAssets/Scenes
folder and then double-click on theMainMenu
file. - From there, let's click on the
2D
button to go into 2D mode if you haven't done so previously.
What we will do is remove the original menu and instead have a button for players to log in via Facebook or play as a guest when the game starts.
- Go to the
Hierarchy
window and select theCanvas - Scale Physical
object and expand it. Select the Panel child and rename itMenu Options
. - Then, duplicate it by pressing Ctrl + D. Then, rename the newly created object
Facebook Login
. Select theMenu Options
again and then disable it by going to theInspector
tab and then clicking on the check beside its name:

We will have the Facebook...