Facebook-Unity integration:
There is a wonderful tutorial located HERE that outlines how you integrate Facebook into Unity3d, so for example if you would like to retrieve a persons friends, posts, etc and use that data inside of Unity. In this specific example, they do this via using a JavaScript webpage and linking to it externally from Unity.
THIS approach is more for a WebPlayer type distribution.
This is the introduction of that tutorial:
A note before you start: This is a Unity tutorial about implementing
Facebook in Unity projects. It’s a technical how-to guide for Unity
developers who want to use Facebook Connect in their web-apps. I In
this 3-part series we’ll learn how to connect our Unity application
with Facebook, show highscores of our friends and how to secure our
application.
There is, however, another way of accessing FaceBook within Unity, and that is by using JSON within Unity. For an example on that, see THIS tutorial.
THIS approach is more likely to be used in a Desktop type distribution.
There are a lot of ways to access Facebook if you are building a game
for the web player but it’s difficult if your game is desktop based as
you have to somehow get the user to login to Facebook and authorize
your application, this is difficult in Unity as it’s WWW class doesn’t
have enough control over it nor does the launch application. I
couldn’t find a solution that existed so I’ve come up with something
that works perfectly, probably not-as elegant but it is a good
trade-off.
As for your question on creating a Facebook app WITH Unity, there are a couple of ways.
Flash Player Facebook Integration:
The the first route, if you are able to, purchase the $400 Adobe Flash plugin for Unity at the store here. While this is expensive, it most certainly would be easier to distribute to Facebook in the future, as Facebook prefers apps to be in Adobe Flash. You can convert your existing webplayer app to flash then upload to Facebook.
Web Basic Integration:
This is basically just embedding your hosted Unity3D web player into a Facebook canvas. This type of integration is the most simple of all because is basically just embedding your Unity3D web player into a Facebook page so people can play it right there. For this you will need to have your Unity3D web player already hosted and running somewhere with public access. The steps are super simple:
- Go to Facebook Developers
- Setup a new application
- Fill the Canvas Page text field with your desired app name
- Fill the Canvas URL text field with the URL of your unity web player
Once you do that, you are done and you app will be already running in Facebook.
If this helps, please uprate and accept! If you have any questions, I will be glad to help!