Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 2017 Mobile Game Development

You're reading from   Unity 2017 Mobile Game Development Build, deploy, and monetize games for Android and iOS with Unity

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781787288713
Length 360 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John P. Doran John P. Doran
Author Profile Icon John P. Doran
John P. Doran
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Building Your Game FREE CHAPTER 2. Setup for Android and iOS Development 3. Mobile Input/Touch Controls 4. Resolution Independent UI 5. Advertising Using Unity Ads 6. Implementing In-App Purchases 7. Getting Social 8. Using Unity Analytics 9. Making Your Title Juicy 10. Game Build and Submission

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:

  1. 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.
  2. 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.

  1. Go to the Hierarchy window and select the Canvas - Scale Physical object and expand it. Select the Panel child and rename it Menu Options.
  2. Then, duplicate it by pressing Ctrl + D. Then, rename the newly created object Facebook Login. Select the Menu Options...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime