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

Sharing high scores via Twitter

Now that we have a scoring system, let's take a look at how we can share a high score using Twitter.

Twitter is an online news and social networking service where users post and interact with each other through messages that they call tweets, which are limited to 280 characters.

Twitter is a great option to start off with because it is very easy to add to our project by simply opening a specific URL:

  1. Open the PauseMenuBehaviour script. Once inside there, we will add the following code inside the PlayerMenuBehaviour class:
#region Share Score via Twitter 
 
// Web address in order to create a tweet 
private const string tweetTextAddress =  
                            "http://twitter.com/intent/tweet?text="; 
 
// Where we want players to visit 
private string appStoreLink = "http://johnpdoran.com/"; 
 
// Reference to...
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 $19.99/month. Cancel anytime