Game Development Reference
UFacebook.MagicToken = MagicToken;
if(GUI.Button(Rect (10,120,100,30),"Get Friends"))
if(profilePic != null)
GUI.Button (Rect (10,155, 100, 100), profilePic);
Step 12 . Play. You will now be able to access a listing of your friends
from inside Unity.
In addition to accessing Facebook data, you can also embed a Unity game
into a Facebook page for others to play, like, and rate. For this you need to
build a Web platform version of your game and have a Web server where
you can host it.
Unity Hands On
Embedding a Unity Game into Facebook
Step 1. Create a Unity game. In Build Settings, build it for the Web
Player Platform. It will save into a folder with two files: HTML and
Unity. Rename the HTML one to index.html .
Step 2. Upload these to a Web server. You should be able to browse
to the game in a Web browser just by using the folder URL. For
this example the game is in http://aardbeistudios.com/facebook/
Step 3. Visit https://facebook.com/developers/ . Login and press the
“+Set Up New App” button in the top right corner of the page.
Step 4. Enter an App name, agree to the terms, and click Create App.