Game Development Reference
In-Depth Information
Fig 8.23 A GUI element to enter the Facebook Magic Token.
Listing 8.13 Code to Switch over to a Magic Token Entering
Box after Facebook Connection Is Made
...
function OnGUI()
{
if(!showTokenBox)
{
GUI.BeginGroup (Rect (10, 10, 200, 100));
GUI.Box (Rect (0,0,200,100), "Facebook");
if(GUI.Button (Rect (25,40,150,30), t))
{
Application.OpenURL(
" https://graph.facebook.com/oauth/authorize " +
" ?client_id=147305235313757&redirect_uri= " +
" http://ifc0nfig.com/Facebook/UnityGame/ " +
"&type=user_agent&display=page");
showTokenBox = true;
}
GUI.EndGroup ();
}
else if(showTokenBox)
{
GUI.BeginGroup (R ect (10, 10, 200, 100));
GUI.Box (Rect (0,0,200,100), "Magic Token");
MagicToken = GUI. TextField (Rect (25, 30, 150, 30),
MagicToken, 120);
if(GUI.Button(Rect( 50, 65, 90, 30), "Authenticate"))
Search Nedrilad ::




Custom Search