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:
- Open the
PauseMenuBehaviour
script. Once inside there, we will add the following code inside thePlayerMenuBehaviour
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 the player for the score public PlayerBehaviour player; /// <summary> /// Will open Twitter with a prebuilt tweet. When called on iOS...