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

Get Unity 2017 Mobile Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.