Game Development Reference
In-Depth Information
//if tweet too long blank out send button
if(Tweet.length < 140)
{
if (GUI.Button(Rect(10,70,80,30), "Submit"))
{
tweetSuccessful = false;
SubmitTweet();
}
}
GUI.Label(Rect(100,70,150,30),tweetSentMessage);
GUI.EndGroup ();
return;
}
//if not authenticated go through the authorisation process
GUI.BeginGroup (Rect (Screen.width / 2 — 50,
Screen.height / 2 — 60, 100, 120));
GUI.Box (Rect (0,0,100,120), "Access Twitter");
if(!Authorized)
{
GUI.Label(Rect (10,30,80,50),
"Authorizing with Twitter. Stand by!");
}
else if(!Connected)
{
GUI.Label(Rect (10,30,80,50),"Pin:");
AccessPIN = GUI.TextField(Rect(10,50,80,30), AccessPIN);
if (GUI.Button(Rect(10,80,80,30), "Submit"))
{
SubmitPIN();
}
}
GUI.EndGroup ();
}
The code in Listing 8.9 displays the box for entering the user's
PIN after they have received it from Twitter. If they are already
connected with Twitter the text field for submitting tweets is
displayed instead.
Step 7. Next you'll want to store the tokens once the user has been
authenticated so that the next time they use your program they
don't need to go through the authentication process again. To
do this we will use the PlayerPrefs functions to set and get these
values.
Search Nedrilad ::




Custom Search