Game Development Reference
In-Depth Information
{
UFacebook.MagicToken = MagicToken;
PlayerPrefs.SetString("FACEBOOKTOKEN", MagicToken);
}
GUI.EndGroup ();
}
}
Step 7. To make use of this connection with your Facebook account,
modify the interface.js code to return the details from your profile as
given in Listing 8.14 .
Listing 8.14 Displaying Information from Facebook
var t: Texture2D;
var MagicToken = "";
...
function RequestUserDetails()
{
if(MagicToken != "")
{
UFacebook.MagicToken = MagicToken;
UFacebook.GetUserProperty("me", "link");
}
return null;
}
function Start()
{
MagicToken = PlayerPrefs.GetString("FACEBOOKTOKEN");
RequestUserDetails();
}
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= " +
Search Nedrilad ::




Custom Search