A good thing to do is to personalize our game to fit our players. So, with that, once the player logs in, we will welcome them and display their image on the screen by following these steps:
- Go to the MainMenuBehaviour script once again. From there, we'll need to add a new using statement to display an image and change the text we need in order to use Unity's UI system:
using UnityEngine.UI; // Text / Image
- We will then need to add two new variables:
[Tooltip("Will display the user's Facebook profile pic")]
public Image profilePic;
[Tooltip("The text object used to display the greeting")]
public Text greeting;
These will hold the information that we wish to display once we get it from Facebook.
- Afterward, we will update the ShowMainMenu function and add some new functions to use:
public void ShowMainMenu()
{
if (facebookLogin != null && mainMenu != null)
{
facebookLogin.SetActive...