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 the Assets/Scenes folder and then double-click on the MainMenu 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 the Canvas - Scale Physical object and expand it. Select the Panel child and rename it Menu Options.
- Then, duplicate it by pressing Ctrl + D. Then, rename the newly created object Facebook Login. Select the Menu Options...