Game Development Reference
Fig 8.17 A simple Twitter posting
Step 15. Log into your Twitter account and check that your message
has gone through.
Step 16 . You can use this very method in your games to send
automatic tweets on behalf of players about their status in the game,
including current score, items they may have purchased, when their
character has died, or when they unlock a level.
Unity Hands On
Twitter Data in 3D
Performing a search on Twitter data is far easier than authenticating for
a single user. You can use the Twitter API to search for any keywords. For
example, http://search.twitter.com/search.json?q=Unity will return JSON
data with tweets mentioning Unity. In this workshop you will use the
Twitter API to get the last tweet posted by a specific user and display their
tweet text and profile image in the Unity 3D environment.
Step 1. Download Chapter Eight/JSON.zip from the Web site.
Open the 3DTweets scene.
Step 2. Play. A male character will be standing on a large plane
with a rocky texture.
Step 3. The tweet and user profile is going to appear on a board
above the character's head. This board is the prefab called Tweeter.
Drag this object into the Scene and position near the character as
shown in Figure 8.18 .
Listing 8.12 . The JSON parser referred to in the code is already in the
project in the Plugins folder.